diff --git a/LatexIndent/AlignmentAtAmpersand.pm b/LatexIndent/AlignmentAtAmpersand.pm index 14f141b0..50fe2410 100644 --- a/LatexIndent/AlignmentAtAmpersand.pm +++ b/LatexIndent/AlignmentAtAmpersand.pm @@ -20,10 +20,12 @@ use utf8; use Unicode::GCString; use Data::Dumper; use Exporter qw/import/; +use List::Util qw(max); use LatexIndent::TrailingComments qw/$trailingCommentRegExp/; use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/; use LatexIndent::GetYamlSettings qw/%masterSettings/; use LatexIndent::Tokens qw/%tokens/; +use LatexIndent::LogFile qw/$logger/; our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321 our @EXPORT_OK = qw/align_at_ampersand find_aligned_block/; our $alignmentBlockCounter; @@ -38,16 +40,16 @@ sub find_aligned_block{ # 1 & 2 & 3 & 4 \\ # 5 & & 6 & \\ # %* \end{tabular} - $self->logger('looking for ALIGNED blocks marked by comments','heading')if($is_t_switch_active); - $self->logger(Dumper(\%{$masterSettings{lookForAlignDelims}})) if($is_t_switch_active); + $logger->trace('*Searching for ALIGNED blocks marked by comments')if($is_t_switch_active); + $logger->trace(Dumper(\%{$masterSettings{lookForAlignDelims}})) if($is_tt_switch_active); while( my ($alignmentBlock,$yesno)= each %{$masterSettings{lookForAlignDelims}}){ if(ref $yesno eq "HASH"){ $yesno = (defined ${$yesno}{delims} ) ? ${$yesno}{delims} : 1; } if($yesno){ - $self->logger("looking for $alignmentBlock:$yesno environments"); + $logger->trace("looking for %*\\begin\{$alignmentBlock\} environments"); - my $noIndentRegExp = qr/ + my $alignmentRegExp = qr/ ( (?!<\\) % @@ -71,13 +73,13 @@ sub find_aligned_block{ #\R /sx; - while( ${$self}{body} =~ m/$noIndentRegExp/sx){ + while( ${$self}{body} =~ m/$alignmentRegExp/sx){ ${$self}{body} =~ s/ - $noIndentRegExp + $alignmentRegExp / # create a new Environment object - my $alignmentBlock = LatexIndent::AlignmentAtAmpersand->new( begin=>$1, + my $alignmentBlockObj = LatexIndent::AlignmentAtAmpersand->new( begin=>$1, body=>$2, end=>$3, name=>$alignmentBlock, @@ -89,13 +91,17 @@ sub find_aligned_block{ }, ); + # log file output + $logger->trace("*Alignment block found: %*\\begin\{$alignmentBlock\}") if $is_t_switch_active; + # the settings and storage of most objects has a lot in common - $self->get_settings_and_store_new_object($alignmentBlock); + $self->get_settings_and_store_new_object($alignmentBlockObj); + ${@{${$self}{children}}[-1]}{replacementText}; /xseg; } } else { - $self->logger("*not* looking for $alignmentBlock as $alignmentBlock:$yesno"); + $logger->trace("*not* looking for $alignmentBlock as $alignmentBlock:$yesno"); } } return; @@ -252,12 +258,16 @@ sub align_at_ampersand{ } # output some of the info so far to the log file - $self->logger("Maximum column sizes of horizontally stripped formatted block (${$self}{name}): @maximumColumnWidth") if $is_t_switch_active; - $self->logger("align at ampersand: ${$self}{lookForAlignDelims}") if $is_t_switch_active; - $self->logger("align at \\\\: ${$self}{alignDoubleBackSlash}") if $is_t_switch_active; - $self->logger("spaces before \\\\: ${$self}{spacesBeforeDoubleBackSlash}") if $is_t_switch_active; - $self->logger("multi column grouping: ${$self}{multiColumnGrouping}") if $is_t_switch_active; - $self->logger("align rows without maximum delimeters: ${$self}{alignRowsWithoutMaxDelims}") if $is_t_switch_active; + $logger->trace("*Alignment at ampersand routine") if $is_t_switch_active; + $logger->trace("Maximum column sizes of horizontally stripped formatted block (${$self}{name}): @maximumColumnWidth") if $is_t_switch_active; + $logger->trace("align at ampersand: ${$self}{lookForAlignDelims}") if $is_t_switch_active; + $logger->trace("align at \\\\: ${$self}{alignDoubleBackSlash}") if $is_t_switch_active; + $logger->trace("spaces before \\\\: ${$self}{spacesBeforeDoubleBackSlash}") if $is_t_switch_active; + $logger->trace("multi column grouping: ${$self}{multiColumnGrouping}") if $is_t_switch_active; + $logger->trace("align rows without maximum delimeters: ${$self}{alignRowsWithoutMaxDelims}") if $is_t_switch_active; + $logger->trace("spaces before ampersand: ${$self}{spacesBeforeAmpersand}") if $is_t_switch_active; + $logger->trace("spaces after ampersand: ${$self}{spacesAfterAmpersand}") if $is_t_switch_active; + $logger->trace("justification: ${$self}{justification}") if $is_t_switch_active; # acount for multicolumn grouping, if the appropriate switch is set if(${$self}{multiColumnGrouping}){ @@ -306,19 +316,34 @@ sub align_at_ampersand{ $maxGroupingWidth = $groupingWidth if($groupingWidth > $maxGroupingWidth); # the cells that receive multicolumn grouping need extra padding; in particular - # the *last* cell of the multicol group receives the padding, hence the - # use of $columnMax below - if(defined @{${$_}{columnSizes}}[$columnMax] and ($columnWidth > ($groupingWidth+3*($multiColSpan-1)) ) and @{${$_}{columnSizes}}[$columnMax] >= 0){ - @{${$_}{multiColPadding}}[$columnMax] = $columnWidth-$groupingWidth-3*($multiColSpan-1); + # if the justification is *left*: + # the *last* cell of the multicol group receives the padding + # if the justification is *right*: + # the *first* cell of the multicol group receives the padding + # + # this motivates the introduction of $columnOffset, which is + # 0 if justification is left + # $multiColSpan if justification is right + my $columnOffset = (${$self}{justification} eq "left") ? $columnMax : $columnCount; + if(defined @{${$_}{columnSizes}}[$columnMax] and ($columnWidth > ($groupingWidth+(${$self}{spacesBeforeAmpersand}+1+${$self}{spacesAfterAmpersand})*($multiColSpan-1)) ) and @{${$_}{columnSizes}}[$columnMax] >= 0){ + my $multiColPadding = $columnWidth-$groupingWidth-(${$self}{spacesBeforeAmpersand}+1+${$self}{spacesAfterAmpersand})*($multiColSpan-1); + + # it's possible that multiColPadding might already be assigned; in which case, + # we need to check that the current value of $multiColPadding is greater than the existing one + if(defined @{${$_}{multiColPadding}}[$columnOffset]){ + @{${$_}{multiColPadding}}[$columnOffset] = max($multiColPadding,@{${$_}{multiColPadding}}[$columnOffset]); + } else { + @{${$_}{multiColPadding}}[$columnOffset] = $multiColPadding; + } # also need to account for maximum column width *including* other multicolumn statements - if($maximumColumnWidthMC[$columnCount]>$columnWidth){ - @{${$_}{multiColPadding}}[$columnMax] += ($maximumColumnWidthMC[$columnCount]-$columnWidth); + if($maximumColumnWidthMC[$columnCount]>$columnWidth and $column !~ m/\\multicolumn\{(\d+)\}/){ + @{${$_}{multiColPadding}}[$columnOffset] += ($maximumColumnWidthMC[$columnCount]-$columnWidth); } } } - # update it to account for the ampersands and 1 space either side of ampersands (total of 3) - $maxGroupingWidth += ($multiColSpan-1)*3; + # update it to account for the ampersands and the spacing either side of ampersands + $maxGroupingWidth += ($multiColSpan-1)*(${$self}{spacesBeforeAmpersand}+1+${$self}{spacesAfterAmpersand}); # store the maxGroupingWidth for use in the next loop @{${$_}{maxGroupingWidth}}[$columnCount] = $maxGroupingWidth; @@ -362,12 +387,29 @@ sub align_at_ampersand{ # underneath the \multicolumn{} statement my $maxGroupingWidth = ${${$_}{maxGroupingWidth}}[$columnCount]; + # it's possible to have situations such as + # + # \multicolumn{3}{l}{one} & \multicolumn{3}{l}{two} & \\ + # \multicolumn{6}{l}{one} & \\ + # + # in which case we need to loop through the @maximumColumnWidthMC + my $groupingWidthMC = 0; + my $multicolsEncountered =0; + for ($columnCount..($columnCount + ($multiColSpan-1))){ + if(defined $maximumColumnWidthMC[$_]){ + $groupingWidthMC += $maximumColumnWidthMC[$_]; + $multicolsEncountered++ if $maximumColumnWidthMC[$_]>0; + } + } + + # need to account for (spacesBeforeAmpersands) + length of ampersands (which is 1) + (spacesAfterAmpersands) + $groupingWidthMC += ($multicolsEncountered-1)*(${$self}{spacesBeforeAmpersand}+1+${$self}{spacesAfterAmpersand}); + # set the padding; we need # maximum( $maxGroupingWidth, $maximumColumnWidthMC[$columnCount] ) - # rather than load another module to give the 'max' function, I use the ternary operator my $maxValueToUse = 0; if(defined $maximumColumnWidthMC[$columnCount]){ - $maxValueToUse = ($maxGroupingWidth>$maximumColumnWidthMC[$columnCount]?$maxGroupingWidth:$maximumColumnWidthMC[$columnCount]); + $maxValueToUse = max($maxGroupingWidth,$maximumColumnWidthMC[$columnCount],$groupingWidthMC); } else { $maxValueToUse = $maxGroupingWidth; } @@ -375,6 +417,19 @@ sub align_at_ampersand{ # calculate the padding $padding = " " x ( $maxValueToUse >= $columnWidth ? $maxValueToUse - $columnWidth : 0 ); + # to the log file + if($is_tt_switch_active){ + $logger->trace("*---------column-------------"); + $logger->trace($column); + $logger->trace("multiColSpan: $multiColSpan"); + $logger->trace("groupingWidthMC: $groupingWidthMC"); + $logger->trace("padding length: ",$maxValueToUse - $columnWidth); + $logger->trace("multicolsEncountered: $multicolsEncountered"); + $logger->trace("maxValueToUse: $maxValueToUse"); + $logger->trace("maximumColumnWidth: ",join(",",@maximumColumnWidth)); + $logger->trace("maximumColumnWidthMC: ",join(",",@maximumColumnWidthMC)); + } + # update the columnCount to account for the multiColSpan $columnCount += $multiColSpan - 1; } else { @@ -383,13 +438,19 @@ sub align_at_ampersand{ } # either way, the row is formed of "COLUMN + PADDING" - $tmpRow .= $column.$padding.(defined @{${$_}{multiColPadding}}[$columnCount] ? " " x @{${$_}{multiColPadding}}[$columnCount]: q())." & "; + if(${$self}{justification} eq "left"){ + $tmpRow .= $column.$padding.(defined @{${$_}{multiColPadding}}[$columnCount] ? " " x @{${$_}{multiColPadding}}[$columnCount]: q()).(" " x ${$self}{spacesBeforeAmpersand})."&".(" " x ${$self}{spacesAfterAmpersand}); + } else { + $tmpRow .= $padding.(defined @{${$_}{multiColPadding}}[$columnCount] ? " " x @{${$_}{multiColPadding}}[$columnCount]: q()).$column.(" " x ${$self}{spacesBeforeAmpersand})."&".(" " x ${$self}{spacesAfterAmpersand}); + } $columnCount++; } # remove the final & - $tmpRow =~ s/\h&\h*$/ /; - $tmpRow =~ s/\h*$/ /; + $tmpRow =~ s/\h*&\h*$/ /; + my $finalSpacing = q(); + $finalSpacing = " " x (${$self}{spacesBeforeDoubleBackSlash}) if ${$self}{spacesBeforeDoubleBackSlash}>=1; + $tmpRow =~ s/\h*$/$finalSpacing/; # replace the row with the formatted row ${$_}{row} = $tmpRow; @@ -430,7 +491,7 @@ sub align_at_ampersand{ # to the log file if($is_tt_switch_active){ - $self->logger(${$_}{row},'ttrace') for @formattedBody; + $logger->trace(${$_}{row}) for @formattedBody; } # delete the original body diff --git a/LatexIndent/Arguments.pm b/LatexIndent/Arguments.pm index 9643bf11..fc6cab0c 100644 --- a/LatexIndent/Arguments.pm +++ b/LatexIndent/Arguments.pm @@ -18,8 +18,9 @@ use strict; use warnings; use LatexIndent::Tokens qw/%tokens/; use LatexIndent::TrailingComments qw/$trailingCommentRegExp/; -use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/; +use LatexIndent::Switches qw/$is_m_switch_active $is_t_switch_active $is_tt_switch_active/; use LatexIndent::GetYamlSettings qw/%masterSettings/; +use LatexIndent::LogFile qw/$logger/; use Data::Dumper; use Exporter qw/import/; our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321 @@ -38,14 +39,15 @@ sub construct_arguments_regexp{ sub indent{ my $self = shift; - $self->logger("Arguments object doesn't receive any direct indentation, but its children will...",'heading') if $is_t_switch_active; + ${$self}{body} =~ s/\R$//s if ($is_m_switch_active and ${$self}{IDFollowedImmediatelyByLineBreak}); + $logger->trace("*Arguments object doesn't receive any direct indentation, but its children will...") if $is_t_switch_active; return; } sub find_opt_mand_arguments{ my $self = shift; - $self->logger("Searching ${$self}{name} for optional and mandatory arguments",'heading') if $is_t_switch_active; + $logger->trace("*Searching ${$self}{name} for optional and mandatory arguments") if $is_t_switch_active; # blank line token my $blankLineToken = $tokens{blanklines}; @@ -54,7 +56,7 @@ sub find_opt_mand_arguments{ my $objectDependentOptAndMandRegExp = (defined ${$self}{optAndMandArgsRegExp} ? ${$self}{optAndMandArgsRegExp} : $optAndMandRegExpWithLineBreaks); if(${$self}{body} =~ m/^$objectDependentOptAndMandRegExp\h*($trailingCommentRegExp)?/){ - $self->logger("Optional/Mandatory arguments found in ${$self}{name}: $1",'heading') if $is_t_switch_active; + $logger->trace("Optional/Mandatory arguments".(${$masterSettings{commandCodeBlocks}}{roundParenthesesAllowed}?" (possibly round Parentheses)":q())." found in ${$self}{name}: $1") if $is_t_switch_active; # create a new Arguments object # The arguments object is a little different to most @@ -81,14 +83,14 @@ sub find_opt_mand_arguments{ if(${$arguments}{body} =~ m/.*?((?logger("Searching for optional arguments, and then mandatory (optional found first)") if $is_t_switch_active; + $logger->trace("Searching for optional arguments, and then mandatory (optional found first)") if $is_t_switch_active; # look for optional arguments $arguments->find_optional_arguments; # look for mandatory arguments $arguments->find_mandatory_arguments; } else { - $self->logger("Searching for mandatory arguments, and then optional (mandatory found first)") if $is_t_switch_active; + $logger->trace("Searching for mandatory arguments, and then optional (mandatory found first)") if $is_t_switch_active; # look for mandatory arguments $arguments->find_mandatory_arguments; @@ -97,7 +99,7 @@ sub find_opt_mand_arguments{ } } else { - $self->logger("Searching for round brackets ONLY") if $is_t_switch_active; + $logger->trace("Searching for round brackets ONLY") if $is_t_switch_active; # look for round brackets $arguments->find_round_brackets; } @@ -111,8 +113,8 @@ sub find_opt_mand_arguments{ and ${$self}{body} !~ m/^$blankLineToken/){ my $BodyStringLogFile = ${$self}{aliases}{BodyStartsOnOwnLine}||"BodyStartsOnOwnLine"; my $BeginStringLogFile = ${${${$arguments}{children}}[0]}{aliases}{BeginStartsOnOwnLine}||"BeginStartsOnOwnLine"; - $self->logger("$BodyStringLogFile = 1 (in ${$self}{name}), but first argument should not begin on its own line (see $BeginStringLogFile)") if $is_t_switch_active; - $self->logger("Removing line breaks at the end of ${$self}{begin}") if $is_t_switch_active; + $logger->trace("$BodyStringLogFile = 1 (in ${$self}{name}), but first argument should not begin on its own line (see $BeginStringLogFile)") if $is_t_switch_active; + $logger->trace("Removing line breaks at the end of ${$self}{begin}") if $is_t_switch_active; ${$self}{begin} =~ s/\R*$//s; ${$self}{linebreaksAtEnd}{begin} = 0; } @@ -121,7 +123,7 @@ sub find_opt_mand_arguments{ # situation: preserveBlankLines is active, so the body may well begin with a blank line token # which means that ${$self}{linebreaksAtEnd}{begin} *should be* 1 if(${${${$arguments}{children}}[0]}{body} =~ m/^($blankLineToken)/){ - $self->logger("Updating {linebreaksAtEnd}{begin} for ${$self}{name} as $blankLineToken or blank line found at beginning of argument child") if $is_t_switch_active; + $logger->trace("Updating {linebreaksAtEnd}{begin} for ${$self}{name} as $blankLineToken or blank line found at beginning of argument child") if $is_t_switch_active; ${$self}{linebreaksAtEnd}{begin} = 1 } @@ -140,20 +142,20 @@ sub find_opt_mand_arguments{ my $BodyStringLogFile = ${$self}{aliases}{BodyStartsOnOwnLine}||"BodyStartsOnOwnLine"; my $BeginStringLogFile = ${${${$arguments}{children}}[0]}{aliases}{BeginStartsOnOwnLine}||"BeginStartsOnOwnLine"; my $BodyValue = (defined ${$self}{BodyStartsOnOwnLine}) ? ${$self}{BodyStartsOnOwnLine} : "0"; - $self->logger("$BodyStringLogFile = $BodyValue (in ${$self}{name}), but first argument *should* begin on its own line (see $BeginStringLogFile)") if $is_t_switch_active; + $logger->trace("$BodyStringLogFile = $BodyValue (in ${$self}{name}), but first argument *should* begin on its own line (see $BeginStringLogFile)") if $is_t_switch_active; # possibly add a comment or a blank line, depending on if BeginStartsOnOwnLine == 2 or 3 respectively # at the end of the begin statement my $trailingCharacterToken = q(); if(${${${$arguments}{children}}[0]}{BeginStartsOnOwnLine}==1){ - $self->logger("Adding line breaks at the end of ${$self}{begin} (first argument, see $BeginStringLogFile == ${${${$arguments}{children}}[0]}{BeginStartsOnOwnLine})") if $is_t_switch_active; + $logger->trace("Adding line breaks at the end of ${$self}{begin} (first argument, see $BeginStringLogFile == ${${${$arguments}{children}}[0]}{BeginStartsOnOwnLine})") if $is_t_switch_active; } elsif(${${${$arguments}{children}}[0]}{BeginStartsOnOwnLine}==2){ - $self->logger("Adding a % at the end of begin, ${$self}{begin} followed by a linebreak ($BeginStringLogFile == 2)") if $is_t_switch_active; + $logger->trace("Adding a % at the end of begin, ${$self}{begin} followed by a linebreak ($BeginStringLogFile == 2)") if $is_t_switch_active; $trailingCharacterToken = "%".$self->add_comment_symbol; - $self->logger("Removing trailing space on ${$self}{begin}") if $is_t_switch_active; + $logger->trace("Removing trailing space on ${$self}{begin}") if $is_t_switch_active; ${$self}{begin} =~ s/\h*$//s; } elsif (${${${$arguments}{children}}[0]}{BeginStartsOnOwnLine}==3) { - $self->logger("Adding a blank line immediately ${$self}{begin} ($BeginStringLogFile==3)") if $is_t_switch_active; + $logger->trace("Adding a blank line immediately ${$self}{begin} ($BeginStringLogFile==3)") if $is_t_switch_active; $trailingCharacterToken = "\n".(${$masterSettings{modifyLineBreaks}}{preserveBlankLines}?$tokens{blanklines}:q()); } @@ -168,7 +170,7 @@ sub find_opt_mand_arguments{ # children need to receive ancestor information, see test-cases/commands/commands-triple-nested.tex foreach (@{${$arguments}{children}}){ - $self->logger("Updating argument children of ${$self}{name} to include ${$self}{id} in ancestors") if $is_t_switch_active; + $logger->trace("Updating argument child of ${$self}{name} to include ${$self}{id} in ancestors") if $is_t_switch_active; push(@{${$_}{ancestors}},{ancestorID=>${$self}{id},ancestorIndentation=>${$self}{indentation},type=>"natural"}); } @@ -176,7 +178,7 @@ sub find_opt_mand_arguments{ # did not add one at the end, and if BodyStartsOnOwnLine >= 1 if( (defined ${${${$arguments}{children}}[-1]}{EndFinishesWithLineBreak} and ${${${$arguments}{children}}[-1]}{EndFinishesWithLineBreak}<1) and (defined ${$self}{BodyStartsOnOwnLine} and ${$self}{BodyStartsOnOwnLine}>=1) ){ - $self->logger("Updating replacementtext to include a linebreak for arguments in ${$self}{name}") if $is_t_switch_active; + $logger->trace("Updating replacementtext to include a linebreak for arguments in ${$self}{name}") if $is_t_switch_active; ${$arguments}{replacementText} .= "\n" if(${$arguments}{linebreaksAtEnd}{end}); } @@ -189,10 +191,10 @@ sub find_opt_mand_arguments{ # delete the regexp, as there's no need for it delete ${${${$self}{children}}[-1]}{regexp}; - $self->logger(Dumper(\%{$arguments}),'ttrace') if($is_tt_switch_active); - $self->logger("replaced with ID: ${$arguments}{id}") if $is_t_switch_active; + $logger->trace(Dumper(\%{$arguments})) if($is_tt_switch_active); + $logger->trace("replaced with ID: ${$arguments}{id}") if $is_tt_switch_active; } else { - $self->logger("... no arguments found") if $is_t_switch_active; + $logger->trace("... no arguments found") if $is_t_switch_active; } } @@ -247,7 +249,7 @@ sub get_arguments_regexp{ } # report to log file - $self->logger("Strings allowed between arguments $stringsBetweenArguments (see stringsAllowedBetweenArguments)",'heading') if $is_t_switch_active; + $logger->trace("*Strings allowed between arguments: $stringsBetweenArguments (see stringsAllowedBetweenArguments)") if $is_t_switch_active; } if(defined ${input}{roundBrackets} and ${input}{roundBrackets}==1){ diff --git a/LatexIndent/BackUpFileProcedure.pm b/LatexIndent/BackUpFileProcedure.pm index dcb3b5bb..a0374552 100644 --- a/LatexIndent/BackUpFileProcedure.pm +++ b/LatexIndent/BackUpFileProcedure.pm @@ -18,6 +18,7 @@ use strict; use warnings; use LatexIndent::GetYamlSettings qw/%masterSettings/; use LatexIndent::Switches qw/%switches/; +use LatexIndent::LogFile qw/$logger/; use File::Basename; # to get the filename and directory path use File::Copy; # to copy the original file to backup (if overwrite option set) use Exporter qw/import/; @@ -31,7 +32,7 @@ sub create_back_up_file{ return unless($switches{overwrite}); # if we want to over write the current file create a backup first - $self->logger("Backup procedure (-w flag active):",'heading'); + $logger->info("*Backup procedure (-w flag active):"); my $fileName = ${$self}{fileName}; @@ -56,8 +57,8 @@ sub create_back_up_file{ # if both ($onlyOneBackUp and $maxNumberOfBackUps) then we have # a conflict- er on the side of caution and turn off onlyOneBackUp if($onlyOneBackUp and $maxNumberOfBackUps>1) { - $self->logger("WARNING: onlyOneBackUp=$onlyOneBackUp and maxNumberOfBackUps: $maxNumberOfBackUps"); - $self->logger("setting onlyOneBackUp=0 which will allow you to reach $maxNumberOfBackUps back ups"); + $logger->warn("*onlyOneBackUp=$onlyOneBackUp and maxNumberOfBackUps: $maxNumberOfBackUps"); + $logger->warn("setting onlyOneBackUp=0 which will allow you to reach $maxNumberOfBackUps back ups"); $onlyOneBackUp = 0; } @@ -65,7 +66,7 @@ sub create_back_up_file{ # they only want one backup if($maxNumberOfBackUps==1) { $onlyOneBackUp=1 ; - $self->logger("FYI: you set maxNumberOfBackUps=1, so I'm setting onlyOneBackUp: 1 "); + $logger->info("you set maxNumberOfBackUps=1, so I'm setting onlyOneBackUp: 1 "); } elsif($maxNumberOfBackUps<=0 and !$onlyOneBackUp) { $onlyOneBackUp=0 ; $maxNumberOfBackUps=-1; @@ -75,8 +76,8 @@ sub create_back_up_file{ # be overwritten each time if($onlyOneBackUp) { $backupFile .= $backupExtension; - $self->logger("copying $fileName to $backupFile"); - $self->logger("$backupFile was overwritten (see onlyOneBackUp)") if (-e $backupFile); + $logger->info("copying $fileName to $backupFile"); + $logger->info("$backupFile was overwritten (see onlyOneBackUp)") if (-e $backupFile); } else { # start with a backup file .bak0 (or whatever $backupExtension is present) my $backupCounter = 0; @@ -85,7 +86,7 @@ sub create_back_up_file{ # if it exists, then keep going: .bak0, .bak1, ... while (-e $backupFile or $maxNumberOfBackUps>1) { if($backupCounter==$maxNumberOfBackUps) { - $self->logger("maxNumberOfBackUps reached ($maxNumberOfBackUps, see maxNumberOfBackUps)"); + $logger->info("maxNumberOfBackUps reached ($maxNumberOfBackUps, see maxNumberOfBackUps)"); # some users may wish to cycle through back up files, e.g: # copy myfile.bak1 to myfile.bak0 @@ -94,7 +95,7 @@ sub create_back_up_file{ # # current back up is stored in myfile.bak4 if($cycleThroughBackUps) { - $self->logger("cycleThroughBackUps detected (see cycleThroughBackUps) "); + $logger->info("cycleThroughBackUps detected (see cycleThroughBackUps) "); for(my $i=1;$i<=$maxNumberOfBackUps;$i++) { # remove number from backUpFile my $oldBackupFile = $backupFile; @@ -107,7 +108,7 @@ sub create_back_up_file{ # check that the oldBackupFile exists if(-e $oldBackupFile){ - $self->logger(" copying $oldBackupFile to $newBackupFile "); + $logger->info(" copying $oldBackupFile to $newBackupFile "); copy($oldBackupFile,$newBackupFile) or die "Could not write to backup file $backupFile. Please check permissions. Exiting."; } } @@ -120,16 +121,16 @@ sub create_back_up_file{ $maxNumberOfBackUps=1; last; # break out of the loop } - $self->logger(" $backupFile already exists, incrementing by 1... (see maxNumberOfBackUps and onlyOneBackUp)"); + $logger->info("$backupFile already exists, incrementing by 1... (see maxNumberOfBackUps and onlyOneBackUp)"); $backupCounter++; $backupFile =~ s/$backupExtension.*/$backupExtension$backupCounter/; } - $self->logger("copying $fileName to $backupFile"); + $logger->info("copying $fileName to $backupFile"); } # output these lines to the log file - $self->logger("Backup file: ",$backupFile,""); - $self->logger("Overwriting file: ",$fileName,""); + $logger->info("Backup file: $backupFile"); + $logger->info("$fileName will be overwritten after indentation"); copy($fileName,$backupFile) or die "Could not write to backup file $backupFile. Please check permissions. Exiting."; } 1; diff --git a/LatexIndent/BlankLines.pm b/LatexIndent/BlankLines.pm index 7f5c5b63..e4041ce2 100644 --- a/LatexIndent/BlankLines.pm +++ b/LatexIndent/BlankLines.pm @@ -19,6 +19,7 @@ use warnings; use LatexIndent::Tokens qw/%tokens/; use LatexIndent::GetYamlSettings qw/%masterSettings/; use LatexIndent::Switches qw/$is_m_switch_active $is_t_switch_active $is_tt_switch_active/; +use LatexIndent::LogFile qw/$logger/; use Exporter qw/import/; our @EXPORT_OK = qw/protect_blank_lines unprotect_blank_lines condense_blank_lines/; @@ -27,11 +28,11 @@ sub protect_blank_lines{ my $self = shift; unless(${$masterSettings{modifyLineBreaks}}{preserveBlankLines}){ - $self->logger("Blank lines will not be protected (preserveBlankLines=0)",'heading') if $is_t_switch_active; + $logger->trace("*Blank lines will not be protected (preserveBlankLines=0)") if $is_t_switch_active; return } - $self->logger("Protecting blank lines (see preserveBlankLines)",'heading') if $is_t_switch_active; + $logger->trace("*Protecting blank lines (see preserveBlankLines)") if $is_t_switch_active; ${$self}{body} =~ s/^(\h*)?\R/$tokens{blanklines}\n/mg; return; } @@ -43,6 +44,7 @@ sub condense_blank_lines{ my $self = shift; + $logger->trace("*condense blank lines routine") if $is_t_switch_active; # if preserveBlankLines is set to 0, then the blank-line-token will not be present # in the document -- we change that here if(${$masterSettings{modifyLineBreaks}}{preserveBlankLines}==0){ @@ -50,12 +52,12 @@ sub condense_blank_lines{ ${$masterSettings{modifyLineBreaks}}{preserveBlankLines}=1; # log file information - $self->logger("Updating body to inclued blank line token, this requires preserveBlankLines = 1",'ttrace') if($is_tt_switch_active); - $self->logger("(any blanklines that could have been removed, would have done so by this point)",'ttrace') if($is_tt_switch_active); + $logger->trace("Updating body to include blank line token, this requires preserveBlankLines = 1") if($is_tt_switch_active); + $logger->trace("(any blanklines that could have been removed, would have done so by this point)") if($is_tt_switch_active); # make the call $self->protect_blank_lines ; - $self->logger("body now looks like:\n${$self}{body}",'ttrace') if($is_tt_switch_active); + $logger->trace("body now looks like:\n${$self}{body}") if($is_tt_switch_active); } # grab the value from the settings @@ -65,15 +67,15 @@ sub condense_blank_lines{ my $blankLineToken = $tokens{blanklines}; # condense! - $self->logger("Condensing multiple blank lines into $condenseMultipleBlankLinesInto (see condenseMultipleBlankLinesInto)",'heading') if $is_t_switch_active; + $logger->trace("Condensing multiple blank lines into $condenseMultipleBlankLinesInto (see condenseMultipleBlankLinesInto)") if $is_t_switch_active; my $replacementToken = $blankLineToken; for (my $i=1; $i<$condenseMultipleBlankLinesInto; $i++ ){ $replacementToken .= "\n$blankLineToken"; } - $self->logger("blank line replacement token: $replacementToken",'ttrace') if($is_tt_switch_active); + $logger->trace("blank line replacement token: $replacementToken") if($is_tt_switch_active); ${$self}{body} =~ s/($blankLineToken\h*\R*\h*){1,}$blankLineToken/$replacementToken/mgs; - $self->logger("body now looks like:\n${$self}{body}",'ttrace') if($is_tt_switch_active); + $logger->trace("body now looks like:\n${$self}{body}") if($is_tt_switch_active); return; } @@ -83,7 +85,7 @@ sub unprotect_blank_lines{ return unless ${$masterSettings{modifyLineBreaks}}{preserveBlankLines}; my $self = shift; - $self->logger("Unprotecting blank lines (see preserveBlankLines)",'heading') if $is_t_switch_active; + $logger->trace("Unprotecting blank lines (see preserveBlankLines)") if $is_t_switch_active; my $blankLineToken = $tokens{blanklines}; # loop through the body, looking for the blank line token @@ -100,8 +102,9 @@ sub unprotect_blank_lines{ # when there is only stuff *after* the blank line token ${$self}{body} =~ s/^$blankLineToken\h*(.*?)$/$1."\n"/emg; } - $self->logger("Finished unprotecting lines (see preserveBlankLines)",'heading') if $is_t_switch_active; - $self->logger("body now looks like ${$self}{body}",'ttrace') if($is_tt_switch_active); + $logger->trace("Finished unprotecting lines (see preserveBlankLines)") if $is_t_switch_active; + $logger->trace("body now looks like:") if($is_tt_switch_active); + $logger->trace("${$self}{body}") if($is_tt_switch_active); } 1; diff --git a/LatexIndent/Braces.pm b/LatexIndent/Braces.pm index c5122fd1..b1c8fc47 100644 --- a/LatexIndent/Braces.pm +++ b/LatexIndent/Braces.pm @@ -22,6 +22,7 @@ use LatexIndent::KeyEqualsValuesBraces qw/$key_equals_values_bracesRegExp $key_e use LatexIndent::NamedGroupingBracesBrackets qw/$grouping_braces_regexp $grouping_braces_regexpTrailingComment/; use LatexIndent::UnNamedGroupingBracesBrackets qw/$un_named_grouping_braces_RegExp $un_named_grouping_braces_RegExp_trailing_comment/; use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/; +use LatexIndent::LogFile qw/$logger/; use Data::Dumper; use Exporter qw/import/; our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321 @@ -32,7 +33,7 @@ sub find_commands_or_key_equals_values_braces{ my $self = shift; - $self->logger("Searching for commands with optional and/or mandatory arguments AND key = {value}",'heading') if $is_t_switch_active ; + $logger->trace("*Searching for commands with optional and/or mandatory arguments AND key = {value}") if $is_t_switch_active ; # match either a \\command or key={value} while( ${$self}{body} =~ m/$commandRegExpTrailingComment/ @@ -49,9 +50,6 @@ sub find_commands_or_key_equals_values_braces{ ${$self}{body} =~ s/ $commandRegExpTrailingComment / - # log file output - $self->logger("command found: $2",'heading') if $is_t_switch_active ; - # create a new command object my $command = LatexIndent::Command->new(begin=>$1.$2.($3?$3:q()).($4?$4:q()), name=>$2, @@ -71,6 +69,9 @@ sub find_commands_or_key_equals_values_braces{ }, optAndMandArgsRegExp=>$optAndMandAndRoundBracketsRegExpLineBreaks, ); + + # log file output + $logger->trace("*command found: $2") if $is_t_switch_active ; # the settings and storage of most objects has a lot in common $self->get_settings_and_store_new_object($command); @@ -83,9 +84,6 @@ sub find_commands_or_key_equals_values_braces{ ${$self}{body} =~ s/ $key_equals_values_bracesRegExpTrailingComment / - # log file output - $self->logger("key_equals_values_braces found: $3",'heading') if $is_t_switch_active ; - # create a new key_equals_values_braces object my $key_equals_values_braces = LatexIndent::KeyEqualsValuesBraces->new( begin=>($2?$2:q()).$3.$4.($5?$5:q()), @@ -107,6 +105,9 @@ sub find_commands_or_key_equals_values_braces{ }, additionalAssignments=>["EqualsStartsOnOwnLine"], ); + + # log file output + $logger->trace("*key_equals_values_braces found: $3") if $is_t_switch_active ; # the settings and storage of most objects has a lot in common $self->get_settings_and_store_new_object($key_equals_values_braces); @@ -119,9 +120,6 @@ sub find_commands_or_key_equals_values_braces{ ${$self}{body} =~ s/ $grouping_braces_regexpTrailingComment / - # log file output - $self->logger("named grouping braces found: $2",'heading') if $is_t_switch_active ; - # create a new key_equals_values_braces object my $grouping_braces = LatexIndent::NamedGroupingBracesBrackets->new( begin=>$2.($3?$3:q()).($4?$4:q()), @@ -142,6 +140,8 @@ sub find_commands_or_key_equals_values_braces{ BodyStartsOnOwnLine=>"NameFinishesWithLineBreak", }, ); + # log file output + $logger->trace("*named grouping braces found: $2") if $is_t_switch_active ; # the settings and storage of most objects has a lot in common $self->get_settings_and_store_new_object($grouping_braces); @@ -153,9 +153,6 @@ sub find_commands_or_key_equals_values_braces{ ${$self}{body} =~ s/ $un_named_grouping_braces_RegExp_trailing_comment / - # log file output - $self->logger("UNnamed grouping braces found: (no name, by definition!)",'heading') if $is_t_switch_active ; - # create a new Un-named-grouping-braces-brackets object my $un_named_grouping_braces = LatexIndent::UnNamedGroupingBracesBrackets->new( begin=>q(), @@ -175,6 +172,9 @@ sub find_commands_or_key_equals_values_braces{ BodyStartsOnOwnLine=>0, ); + # log file output + $logger->trace("*UNnamed grouping braces found: (no name, by definition!)") if $is_t_switch_active ; + # the settings and storage of most objects has a lot in common $self->get_settings_and_store_new_object($un_named_grouping_braces); ${@{${$self}{children}}[-1]}{replacementText}.($6?($8?$8:q()):q()); diff --git a/LatexIndent/Command.pm b/LatexIndent/Command.pm index db876c4c..acd118ec 100644 --- a/LatexIndent/Command.pm +++ b/LatexIndent/Command.pm @@ -20,6 +20,7 @@ use LatexIndent::Tokens qw/%tokens/; use LatexIndent::TrailingComments qw/$trailingCommentRegExp/; use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/; use LatexIndent::GetYamlSettings qw/%masterSettings/; +use LatexIndent::LogFile qw/$logger/; use Data::Dumper; use Exporter qw/import/; our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321 @@ -58,7 +59,7 @@ sub construct_command_regexp{ } # details to log file - $self->logger("The special command names regexp is: $commandNameSpecialRegExp (see commandNameSpecial)",'heading') if $is_t_switch_active; + $logger->trace("*The special command names regexp is: $commandNameSpecialRegExp (see commandNameSpecial)") if $is_t_switch_active; # construct the command regexp $commandRegExp = qr/ @@ -92,7 +93,7 @@ sub tasks_particular_to_each_object{ if(${${$self}{linebreaksAtEnd}}{end} == 1 and ${${${$self}{children}}[0]}{body} =~ m/\R$/s and !${$self}{endImmediatelyFollowedByComment}){ - $self->logger("Removing linebreak from argument container of ${$self}{name}") if $is_t_switch_active; + $logger->trace("Removing linebreak from argument container of ${$self}{name}") if $is_t_switch_active; ${${${$self}{children}}[0]}{body} =~ s/\R$//s; ${${${${$self}{children}}[0]}{linebreaksAtEnd}}{body} = 0; } @@ -103,7 +104,7 @@ sub tasks_particular_to_each_object{ and defined ${${${${$self}{children}}[0]}{children}[-1]}{EndFinishesWithLineBreak} and ${${${${$self}{children}}[0]}{children}[-1]}{EndFinishesWithLineBreak} == -1 ){ - $self->logger("Switching linebreaksAtEnd{end} to be 0 in command ${$self}{name} as last argument specifies EndFinishesWithLineBreak == 0") if $is_t_switch_active; + $logger->trace("Switching linebreaksAtEnd{end} to be 0 in command ${$self}{name} as last argument specifies EndFinishesWithLineBreak == 0") if $is_t_switch_active; ${${$self}{linebreaksAtEnd}}{end} = 0; ${$self}{EndFinishesWithLineBreak} = -1; } @@ -117,30 +118,30 @@ sub tasks_particular_to_each_object{ and !${$self}{endImmediatelyFollowedByComment}){ # update the Command object - $self->logger("Adjusting linebreaksAtEnd in command ${$self}{name}") if $is_t_switch_active; + $logger->trace("Adjusting linebreaksAtEnd in command ${$self}{name}") if $is_t_switch_active; ${${$self}{linebreaksAtEnd}}{end} = ${${${${${$self}{children}}[0]}{children}[-1]}{linebreaksAtEnd}}{end}; ${$self}{replacementText} .= "\n"; # if the last argument has EndFinishesWithLineBreak == 3 if (${${${${$self}{children}}[0]}{children}[-1]}{EndFinishesWithLineBreak} == 3 ){ my $EndStringLogFile = ${${${${$self}{children}}[0]}{children}[-1]}{aliases}{EndFinishesWithLineBreak}||"EndFinishesWithLineBreak"; - $self->logger("Adding another blank line to replacement text for ${$self}{name} as last argument has $EndStringLogFile == 3 ") if $is_t_switch_active; + $logger->trace("Adding another blank line to replacement text for ${$self}{name} as last argument has $EndStringLogFile == 3 ") if $is_t_switch_active; ${$self}{replacementText} .= (${$masterSettings{modifyLineBreaks}}{preserveBlankLines}?$tokens{blanklines}:"\n")."\n"; } # update the argument object - $self->logger("Adjusting argument object in command, ${$self}{name}") if $is_t_switch_active; + $logger->trace("Adjusting argument object in command, ${$self}{name}") if $is_t_switch_active; ${${${${$self}{children}}[0]}{linebreaksAtEnd}}{body} = 0; ${${${$self}{children}}[0]}{body} =~ s/\R$//s; # update the last mandatory/optional argument - $self->logger("Adjusting last argument in command, ${$self}{name}") if $is_t_switch_active; + $logger->trace("Adjusting last argument in command, ${$self}{name}") if $is_t_switch_active; ${${${${${$self}{children}}[0]}{children}[-1]}{linebreaksAtEnd}}{end} = 0; ${${${${$self}{children}}[0]}{children}[-1]}{EndFinishesWithLineBreak} = -1; ${${${${$self}{children}}[0]}{children}[-1]}{replacementText} =~ s/\R$//s; # output to log file - $self->logger(Dumper(${${${$self}{children}}[0]}{children}[-1])) if $is_t_switch_active; + $logger->trace(Dumper(${${${$self}{children}}[0]}{children}[-1])) if $is_tt_switch_active; } # situation: ${${$self}{linebreaksAtEnd}}{end} == 1 and the last argument has added @@ -152,12 +153,12 @@ sub tasks_particular_to_each_object{ and !${$self}{endImmediatelyFollowedByComment}){ # last argument adjustment - $self->logger("Adjusting last argument in command, ${$self}{name} to avoid double line break") if $is_t_switch_active; + $logger->trace("Adjusting last argument in command, ${$self}{name} to avoid double line break") if $is_t_switch_active; ${${${${$self}{children}}[0]}{children}[-1]}{replacementText}=~s/\R$//s; ${${${${${$self}{children}}[0]}{children}[-1]}{linebreaksAtEnd}}{end} = 0; # argument object adjustment - $self->logger("Adjusting argument object in command, ${$self}{name} to avoid double line break") if $is_t_switch_active; + $logger->trace("Adjusting argument object in command, ${$self}{name} to avoid double line break") if $is_t_switch_active; ${${${${$self}{children}}[0]}{linebreaksAtEnd}}{body} = 0; ${${${$self}{children}}[0]}{body}=~s/\R$//s; } @@ -167,7 +168,7 @@ sub tasks_particular_to_each_object{ # # see ../test-cases/texexchange/5461.tex which was the first example to demonstrate the need for this if(!${${${$self}{children}}[0]}{endImmediatelyFollowedByComment} and ${${${$self}{children}}[0]}{body} =~ m/\h*$/ and ${$self}{replacementText} !~ m/\R$/){ - $self->logger("${$self}{name}: trailling horizontal space found in arguments -- removing it from arguments, adding to replacement text") if $is_t_switch_active; + $logger->trace("${$self}{name}: trailling horizontal space found in arguments -- removing it from arguments, adding to replacement text") if $is_t_switch_active; ${${${$self}{children}}[0]}{body} =~ s/(\h*)$//s; ${$self}{replacementText} .= "$1"; } diff --git a/LatexIndent/Document.pm b/LatexIndent/Document.pm index 8697c20e..03817c8d 100644 --- a/LatexIndent/Document.pm +++ b/LatexIndent/Document.pm @@ -22,12 +22,12 @@ use open ':std', ':encoding(UTF-8)'; # gain access to subroutines in the following modules use LatexIndent::Switches qw/storeSwitches %switches $is_m_switch_active $is_t_switch_active $is_tt_switch_active/; -use LatexIndent::LogFile qw/logger output_logfile processSwitches/; +use LatexIndent::LogFile qw/processSwitches $logger/; use LatexIndent::GetYamlSettings qw/readSettings modify_line_breaks_settings get_indentation_settings_for_this_object get_every_or_custom_value get_indentation_information get_object_attribute_for_indentation_settings alignment_at_ampersand_settings %masterSettings/; use LatexIndent::FileExtension qw/file_extension_check/; use LatexIndent::BackUpFileProcedure qw/create_back_up_file/; use LatexIndent::BlankLines qw/protect_blank_lines unprotect_blank_lines condense_blank_lines/; -use LatexIndent::ModifyLineBreaks qw/modify_line_breaks_body modify_line_breaks_end remove_line_breaks_begin adjust_line_breaks_end_parent max_char_per_line paragraphs_on_one_line construct_paragraph_reg_exp/; +use LatexIndent::ModifyLineBreaks qw/modify_line_breaks_body modify_line_breaks_end remove_line_breaks_begin adjust_line_breaks_end_parent max_char_per_line paragraphs_on_one_line construct_paragraph_reg_exp one_sentence_per_line/; use LatexIndent::TrailingComments qw/remove_trailing_comments put_trailing_comments_back_in add_comment_symbol construct_trailing_comment_regexp/; use LatexIndent::HorizontalWhiteSpace qw/remove_trailing_whitespace remove_leading_space/; use LatexIndent::Indent qw/indent wrap_up_statement determine_total_indentation indent_begin indent_body indent_end_statement final_indentation_check get_surrounding_indentation indent_children_recursively check_for_blank_lines_at_beginning put_blank_lines_back_in_at_beginning add_surrounding_indentation_to_begin_statement post_indentation_check/; @@ -64,6 +64,7 @@ sub new{ my $invocant = shift; my $class = ref($invocant) || $invocant; my $self = {@_}; + $logger->trace(${$masterSettings{logFilePreferences}}{showDecorationStartCodeBlockTrace}) if ${$masterSettings{logFilePreferences}}{showDecorationStartCodeBlockTrace}; bless ($self,$class); return $self; } @@ -72,7 +73,6 @@ sub latexindent{ my $self = shift; $self->storeSwitches; $self->processSwitches; - $self->readSettings; $self->file_extension_check; $self->operate_on_file; } @@ -94,6 +94,7 @@ sub operate_on_file{ $self->find_file_contents_environments_and_preamble; $self->dodge_double_backslash; $self->remove_leading_space; + $self->one_sentence_per_line if $is_m_switch_active; $self->process_body_of_text; $self->remove_trailing_whitespace(when=>"after"); $self->condense_blank_lines; @@ -103,7 +104,6 @@ sub operate_on_file{ $self->put_trailing_comments_back_in; $self->put_verbatim_commands_back_in; $self->output_indented_text; - $self->output_logfile; return } @@ -125,25 +125,32 @@ sub construct_regular_expressions{ sub output_indented_text{ my $self = shift; - # output to screen, unless silent mode - print ${$self}{body} unless $switches{silentMode}; - - $self->logger("Output routine",'heading'); + $logger->info("*Output routine:"); # if -overwrite is active then output to original fileName if($switches{overwrite}) { - $self->logger("Overwriting file ${$self}{fileName}"); + $logger->info("Overwriting file ${$self}{fileName}"); open(OUTPUTFILE,">",${$self}{fileName}); print OUTPUTFILE ${$self}{body}; close(OUTPUTFILE); } elsif($switches{outputToFile}) { - $self->logger("Outputting to file $switches{outputToFile}"); + $logger->info("Outputting to file $switches{outputToFile}"); open(OUTPUTFILE,">",$switches{outputToFile}); print OUTPUTFILE ${$self}{body}; close(OUTPUTFILE); } else { - $self->logger("Not outputting to file; see -w and -o switches for more options."); + $logger->info("Not outputting to file; see -w and -o switches for more options."); } + + # put the final line in the logfile + $logger->info("${$masterSettings{logFilePreferences}}{endLogFileWith}") if ${$masterSettings{logFilePreferences}}{endLogFileWith}; + + # github info line + $logger->info("*Please direct all communication/issues to:\nhttps://github.com/cmhughes/latexindent.pl") if ${$masterSettings{logFilePreferences}}{showGitHubInfoFooter}; + + # output to screen, unless silent mode + print ${$self}{body} unless $switches{silentMode}; + return; } @@ -151,19 +158,19 @@ sub process_body_of_text{ my $self = shift; # find objects recursively - $self->logger('Phase 1: searching for objects','heading'); + $logger->info('*Phase 1: searching for objects'); $self->find_objects; # find all hidden child - $self->logger('Phase 2: finding surrounding indentation','heading'); + $logger->info('*Phase 2: finding surrounding indentation'); $self->find_surrounding_indentation_for_children; # indentation recursively - $self->logger('Phase 3: indenting objects','heading'); + $logger->info('*Phase 3: indenting objects'); $self->indent_children_recursively; # final indentation check - $self->logger('Phase 4: final indentation check','heading'); + $logger->info('*Phase 4: final indentation check'); $self->final_indentation_check; return; @@ -173,15 +180,15 @@ sub find_objects{ my $self = shift; # search for environments - $self->logger('looking for ENVIRONMENTS') if $is_t_switch_active; + $logger->trace('looking for ENVIRONMENTS') if $is_t_switch_active; $self->find_environments; # search for ifElseFi blocks - $self->logger('looking for IFELSEFI') if $is_t_switch_active; + $logger->trace('looking for IFELSEFI') if $is_t_switch_active; $self->find_ifelsefi; # search for headings (part, chapter, section, setc) - $self->logger('looking for HEADINGS (chapter, section, part, etc)') if $is_t_switch_active; + $logger->trace('looking for HEADINGS (chapter, section, part, etc)') if $is_t_switch_active; $self->find_heading; # the ordering of finding commands and special code blocks can change @@ -195,16 +202,14 @@ sub find_objects{ # if there are no children, return if(${$self}{children}){ - $self->logger("Objects have been found.",'heading') if $is_t_switch_active; + $logger->trace("*Objects have been found.") if $is_t_switch_active; } else { - $self->logger("No objects found."); + $logger->trace("No objects found."); return; } # logfile information - $self->logger(Dumper(\%{$self}),'ttrace') if($is_tt_switch_active); - $self->logger("Operating on: ${$self}{name}",'heading')if $is_t_switch_active; - $self->logger("Number of children: ".scalar (@{${$self}{children}})) if $is_t_switch_active; + $logger->trace(Dumper(\%{$self})) if($is_tt_switch_active); return; } @@ -216,19 +221,19 @@ sub find_commands_or_key_equals_values_braces_and_special{ # can change depending upon specialBeforeCommand if(${$masterSettings{specialBeginEnd}}{specialBeforeCommand}){ # search for special begin/end - $self->logger('looking for SPECIAL begin/end *before* looking for commands (see specialBeforeCommand)') if $is_t_switch_active; + $logger->trace('looking for SPECIAL begin/end *before* looking for commands (see specialBeforeCommand)') if $is_t_switch_active; $self->find_special; # search for commands with arguments - $self->logger('looking for COMMANDS and key = {value}') if $is_t_switch_active; + $logger->trace('looking for COMMANDS and key = {value}') if $is_t_switch_active; $self->find_commands_or_key_equals_values_braces; } else { # search for commands with arguments - $self->logger('looking for COMMANDS and key = {value}') if $is_t_switch_active; + $logger->trace('looking for COMMANDS and key = {value}') if $is_t_switch_active; $self->find_commands_or_key_equals_values_braces; # search for special begin/end - $self->logger('looking for SPECIAL begin/end') if $is_t_switch_active; + $logger->trace('looking for SPECIAL begin/end') if $is_t_switch_active; $self->find_special; } return; @@ -236,7 +241,7 @@ sub find_commands_or_key_equals_values_braces_and_special{ sub tasks_particular_to_each_object{ my $self = shift; - $self->logger("There are no tasks particular to ${$self}{name}") if $is_t_switch_active; + $logger->trace("There are no tasks particular to ${$self}{name}") if $is_t_switch_active; } sub get_settings_and_store_new_object{ @@ -254,6 +259,8 @@ sub get_settings_and_store_new_object{ # store children in special hash push(@{${$self}{children}},$latexIndentObject); + # possible decoration in log file + $logger->trace(${$masterSettings{logFilePreferences}}{showDecorationFinishCodeBlockTrace}) if ${$masterSettings{logFilePreferences}}{showDecorationFinishCodeBlockTrace}; } sub tasks_common_to_each_object{ @@ -264,12 +271,12 @@ sub tasks_common_to_each_object{ # update/create the ancestor information if($parent{ancestors}){ - $self->logger("Ancestors *have* been found for ${$self}{name}") if($is_t_switch_active); + $logger->trace("Ancestors *have* been found for ${$self}{name}") if($is_t_switch_active); push(@{${$self}{ancestors}},@{$parent{ancestors}}); } else { - $self->logger("No ancestors found for ${$self}{name}") if($is_t_switch_active); + $logger->trace("No ancestors found for ${$self}{name}") if($is_t_switch_active); if(defined $parent{id} and $parent{id} ne ''){ - $self->logger("Creating ancestors with $parent{id} as the first one") if($is_t_switch_active); + $logger->trace("Creating ancestors with $parent{id} as the first one") if($is_t_switch_active); push(@{${$self}{ancestors}},{ancestorID=>$parent{id},ancestorIndentation=>\$parent{indentation},type=>"natural",name=>${$self}{name}}); } } @@ -328,7 +335,7 @@ sub adjust_replacement_text_line_breaks_at_end{ # the above regexp, when used below, will remove the trailing linebreak in ${$self}{linebreaksAtEnd}{end} # so we compensate for it here - $self->logger("Putting linebreak after replacementText for ${$self}{name}") if($is_t_switch_active); + $logger->trace("Putting linebreak after replacementText for ${$self}{name}") if($is_t_switch_active); if(defined ${$self}{horizontalTrailingSpace}){ ${$self}{replacementText} .= ${$self}{horizontalTrailingSpace} unless(!${$self}{endImmediatelyFollowedByComment} and defined ${$self}{EndFinishesWithLineBreak} and ${$self}{EndFinishesWithLineBreak}==2); } @@ -345,7 +352,7 @@ sub count_body_line_breaks{ my $bodyLineBreaks = 0; $bodyLineBreaks++ while(${$self}{body} =~ m/\R/sxg); ${$self}{bodyLineBreaks} = $bodyLineBreaks; - $self->logger("bodyLineBreaks ${$self}{bodyLineBreaks}") if((${$self}{bodyLineBreaks} != $oldBodyLineBreaks) and $is_t_switch_active); + $logger->trace("bodyLineBreaks ${$self}{bodyLineBreaks}") if((${$self}{bodyLineBreaks} != $oldBodyLineBreaks) and $is_t_switch_active); } sub wrap_up_tasks{ @@ -357,8 +364,8 @@ sub wrap_up_tasks{ # check if the last object was the last thing in the body, and if it has adjusted linebreaks $self->adjust_line_breaks_end_parent; - $self->logger(Dumper(\%{$child})) if($is_tt_switch_active); - $self->logger("replaced with ID: ${$child}{id}") if $is_t_switch_active; + $logger->trace(Dumper(\%{$child})) if($is_tt_switch_active); + $logger->trace("replaced with ID: ${$child}{id}") if $is_t_switch_active; } diff --git a/LatexIndent/Else.pm b/LatexIndent/Else.pm index 878a68dc..fe2664cf 100644 --- a/LatexIndent/Else.pm +++ b/LatexIndent/Else.pm @@ -19,6 +19,7 @@ use warnings; use LatexIndent::Tokens qw/%tokens/; use LatexIndent::TrailingComments qw/$trailingCommentRegExp/; use LatexIndent::Switches qw/$is_m_switch_active $is_t_switch_active $is_tt_switch_active/; +use LatexIndent::LogFile qw/$logger/; use Data::Dumper; use Exporter qw/import/; our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321 @@ -37,12 +38,10 @@ our $elseRegExp = qr/ sub check_for_else_statement{ my $self = shift; - $self->logger("Looking for \\else statement (${$self}{name})",'heading') if $is_t_switch_active; + $logger->trace("*Looking for \\else statement (${$self}{name})") if $is_t_switch_active; ${$self}{body} =~ s/$elseRegExp(\h*)($trailingCommentRegExp)? - / # log file output - $self->logger("else found: ${$self}{name}",'heading')if $is_t_switch_active; - + / # create a new IfElseFi object my $else = LatexIndent::Else->new(begin=>$1, name=>${$self}{name}, @@ -64,6 +63,9 @@ sub check_for_else_statement{ endImmediatelyFollowedByComment=>0, horizontalTrailingSpace=>q(), ); + # log file output + $logger->trace("*else found: ${$self}{name}")if $is_t_switch_active; + # the settings and storage of most objects has a lot in common $self->get_settings_and_store_new_object($else); ${@{${$self}{children}}[-1]}{replacementText}; @@ -76,7 +78,7 @@ sub remove_line_breaks_begin{ # there is no white space my $self = shift; my $BodyStringLogFile = ${$self}{aliases}{BodyStartsOnOwnLine}||"BodyStartsOnOwnLine"; - $self->logger("Removing linebreak at the end of begin (see $BodyStringLogFile)"); + $logger->trace("Removing linebreak at the end of begin (see $BodyStringLogFile)"); ${$self}{begin} =~ s/\R*$//sx; ${$self}{begin} .= " " unless(${$self}{begin} =~ m/\h$/s or ${$self}{body} =~ m/^\h/s or ${$self}{body} =~ m/^\R/s ); ${$self}{linebreaksAtEnd}{begin} = 0; diff --git a/LatexIndent/Environment.pm b/LatexIndent/Environment.pm index 0dd2fa80..b3b5b431 100644 --- a/LatexIndent/Environment.pm +++ b/LatexIndent/Environment.pm @@ -19,6 +19,7 @@ use warnings; use LatexIndent::Tokens qw/%tokens/; use LatexIndent::TrailingComments qw/$trailingCommentRegExp/; use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/; +use LatexIndent::LogFile qw/$logger/; use Data::Dumper; use Exporter qw/import/; our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321 @@ -61,9 +62,6 @@ sub find_environments{ ${$self}{body} =~ s/ $environmentRegExp(\h*)($trailingCommentRegExp)? / - # log file output - $self->logger("environment found: $2",'heading') if $is_t_switch_active; - # create a new Environment object my $env = LatexIndent::Environment->new(begin=>$1, name=>$2, @@ -79,6 +77,9 @@ sub find_environments{ horizontalTrailingSpace=>$7?$7:q(), ); + # log file output + $logger->trace("*environment found: $2") if $is_t_switch_active; + # the settings and storage of most objects has a lot in common $self->get_settings_and_store_new_object($env); ${@{${$self}{children}}[-1]}{replacementText}.($9?$9:q()).($10?$10:q()); @@ -93,7 +94,7 @@ sub tasks_particular_to_each_object{ # if the environment is empty, we may need to update linebreaksAtEnd{body} if(${$self}{body} =~ m/^\h*$/s and ${${$self}{linebreaksAtEnd}}{begin}){ - $self->logger("empty environment body (${$self}{name}), updating linebreaksAtEnd{body} to be 1") if($is_t_switch_active); + $logger->trace("empty environment body (${$self}{name}), updating linebreaksAtEnd{body} to be 1") if($is_t_switch_active); ${${$self}{linebreaksAtEnd}}{body} = 1; } diff --git a/LatexIndent/FileContents.pm b/LatexIndent/FileContents.pm index 802b2a1e..4ad2623f 100644 --- a/LatexIndent/FileContents.pm +++ b/LatexIndent/FileContents.pm @@ -19,6 +19,7 @@ use warnings; use LatexIndent::Tokens qw/%tokens/; use LatexIndent::GetYamlSettings qw/%masterSettings/; use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/; +use LatexIndent::LogFile qw/$logger/; use Data::Dumper; use Exporter qw/import/; our @EXPORT_OK = qw/find_file_contents_environments_and_preamble/; @@ -34,11 +35,11 @@ sub find_file_contents_environments_and_preamble{ my @fileContentsStorageArray; # fileContents environments - $self->logger('looking for FILE CONTENTS environments (see fileContentsEnvironments)','heading') if $is_t_switch_active; - $self->logger(Dumper(\%{$masterSettings{fileContentsEnvironments}})) if($is_t_switch_active); + $logger->trace('*Searching for FILE CONTENTS environments (see fileContentsEnvironments)') if $is_t_switch_active; + $logger->trace(Dumper(\%{$masterSettings{fileContentsEnvironments}})) if($is_tt_switch_active); while( my ($fileContentsEnv,$yesno)= each %{$masterSettings{fileContentsEnvironments}}){ if($yesno){ - $self->logger("looking for $fileContentsEnv:$yesno environments") if $is_t_switch_active; + $logger->trace("looking for $fileContentsEnv environments") if $is_t_switch_active; # the trailing * needs some care if($fileContentsEnv =~ m/\*$/){ @@ -93,15 +94,15 @@ sub find_file_contents_environments_and_preamble{ push(@fileContentsStorageArray,$fileContentsBlock); # log file output - $self->logger("FILECONTENTS environment found: $fileContentsEnv"); + $logger->trace("FILECONTENTS environment found: $fileContentsEnv"); # remove the environment block, and replace with unique ID ${$self}{body} =~ s/$fileContentsRegExp/${$fileContentsBlock}{replacementText}/sx; - $self->logger("replaced with ID: ${$fileContentsBlock}{id}"); + $logger->trace("replaced with ID: ${$fileContentsBlock}{id}") if $is_tt_switch_active; } } else { - $self->logger("*not* looking for $fileContentsEnv as $fileContentsEnv:$yesno"); + $logger->trace("*not* looking for $fileContentsEnv as $fileContentsEnv:$yesno"); } } @@ -119,7 +120,7 @@ sub find_file_contents_environments_and_preamble{ # try and find the preamble if( ${$self}{body} =~ m/$preambleRegExp/sx and ${$masterSettings{lookForPreamble}}{${$self}{fileExtension}}){ - $self->logger("\\begin{document} found in body (after searching for filecontents)-- assuming that a preamble exists",'heading') if $is_t_switch_active ; + $logger->trace("\\begin{document} found in body (after searching for filecontents)-- assuming that a preamble exists",'heading') if $is_t_switch_active ; # create a preamble object $preamble = LatexIndent::Preamble->new( begin=>q(), @@ -142,19 +143,19 @@ sub find_file_contents_environments_and_preamble{ $preamble->get_replacement_text; # log file output - $self->logger("preamble found: $preamble") if $is_t_switch_active; + $logger->trace("preamble found: preamble") if $is_t_switch_active; # remove the environment block, and replace with unique ID ${$self}{body} =~ s/$preambleRegExp/${$preamble}{replacementText}/sx; - $self->logger("replaced with ID: ${$preamble}{replacementText}") if $is_t_switch_active; + $logger->trace("replaced with ID: ${$preamble}{replacementText}") if $is_tt_switch_active; # indentPreamble set to 1 if($masterSettings{indentPreamble}){ - $self->logger("storing ${$preamble}{id} for indentation (see indentPreamble)"); + $logger->trace("storing ${$preamble}{id} for indentation (see indentPreamble)"); $needToStorePreamble = 1; } else { # indentPreamble set to 0 - $self->logger("NOT storing ${$preamble}{id} for indentation -- will store as VERBATIM object (see indentPreamble)") if $is_t_switch_active; + $logger->trace("NOT storing ${$preamble}{id} for indentation -- will store as VERBATIM object (because indentPreamble:0)") if $is_t_switch_active; $preamble->unprotect_blank_lines; ${$self}{verbatim}{${$preamble}{id}} = $preamble; } @@ -167,18 +168,18 @@ sub find_file_contents_environments_and_preamble{ my $indentThisChild = 0; # verbatim children go in special hash if($preamble ne '' and ${$preamble}{body} =~ m/${$_}{id}/){ - $self->logger("filecontents (${$_}{id}) is within preamble"); + $logger->trace("filecontents (${$_}{id}) is within preamble"); # indentPreamble set to 1 if($masterSettings{indentPreamble}){ - $self->logger("storing ${$_}{id} for indentation (indentPreamble is 1)"); + $logger->trace("storing ${$_}{id} for indentation (indentPreamble is 1)"); $indentThisChild = 1; } else { # indentPreamble set to 0 - $self->logger("Storing ${$_}{id} as a VERBATIM object (indentPreamble is 0)"); + $logger->trace("Storing ${$_}{id} as a VERBATIM object (indentPreamble is 0)"); ${$self}{verbatim}{${$_}{id}}=$_; } } else { - $self->logger("storing ${$_}{id} for indentation (${$_}{name} found outside of preamble)"); + $logger->trace("storing ${$_}{id} for indentation (${$_}{name} found outside of preamble)"); $indentThisChild = 1; } # store the child, if necessary @@ -187,6 +188,9 @@ sub find_file_contents_environments_and_preamble{ $_->get_indentation_settings_for_this_object; $_->tasks_particular_to_each_object; push(@{${$self}{children}},$_); + + # possible decoration in log file + $logger->trace(${$masterSettings{logFilePreferences}}{showDecorationFinishCodeBlockTrace}) if ${$masterSettings{logFilePreferences}}{showDecorationFinishCodeBlockTrace}; } } diff --git a/LatexIndent/FileExtension.pm b/LatexIndent/FileExtension.pm index c2f6d0fc..93f8016f 100644 --- a/LatexIndent/FileExtension.pm +++ b/LatexIndent/FileExtension.pm @@ -21,6 +21,7 @@ use PerlIO::encoding; use open ':std', ':encoding(UTF-8)'; use File::Basename; # to get the filename and directory path use Exporter qw/import/; +use Log::Log4perl qw(get_logger :levels); use LatexIndent::GetYamlSettings qw/%masterSettings/; use LatexIndent::Switches qw/%switches/; our @EXPORT_OK = qw/file_extension_check/; @@ -28,6 +29,9 @@ our @EXPORT_OK = qw/file_extension_check/; sub file_extension_check{ my $self = shift; + # grab the logger object + my $logger = get_logger("Document"); + # grab the filename my $fileName = ${$self}{fileName}; @@ -44,50 +48,47 @@ sub file_extension_check{ # check to make sure given file type is supported if( -e $fileName and !$ext ){ my $message = "The file $fileName exists , but the extension does not correspond to any given in fileExtensionPreference; consinder updating fileExtensionPreference."; - $self->logger($message,'heading'); - $self->output_logfile; + $logger->fatal("*$message"); die($message); } # if no extension, search according to fileExtensionPreference - if (!$ext) { - $self->logger("File extension work:",'heading'); - $self->logger("latexindent called to act upon $fileName with an, as yet, unrecognised file extension;"); - $self->logger("searching for file with an extension in the following order (see fileExtensionPreference):"); - $self->logger(join("\n",@fileExtensions)); - - my $fileFound = 0; - # loop through the known file extensions (see @fileExtensions) - foreach (@fileExtensions ){ - if ( -e $fileName.$_ ) { - $self->logger("$fileName$_ found!"); - $fileName .= $_; - $self->logger("Updated fileName to $fileName"); - ${$self}{fileName} = $fileName ; - $fileFound = 1; - $ext = $_; - last; + if ($fileName ne "-"){ + if (!$ext) { + $logger->info("*File extension work:"); + $logger->info("latexindent called to act upon $fileName with a file extension;\nsearching for file with an extension in the following order (see fileExtensionPreference):"); + $logger->info(join("\n",@fileExtensions)); + + my $fileFound = 0; + # loop through the known file extensions (see @fileExtensions) + foreach (@fileExtensions ){ + if ( -e $fileName.$_ ) { + $logger->info("$fileName$_ found!"); + $fileName .= $_; + $logger->info("Updated fileName to $fileName"); + ${$self}{fileName} = $fileName ; + $fileFound = 1; + $ext = $_; + last; + } + } + unless($fileFound){ + $logger->fatal("*I couldn't find a match for $fileName in fileExtensionPreference (see defaultSettings.yaml)"); + foreach (@fileExtensions ){ + $logger->fatal("I searched for $fileName$_"); + } + $logger->fatal("but couldn't find any of them.\nConsider updating fileExtensionPreference.\nExiting, no indendation done."); + die "I couldn't find a match for $fileName in fileExtensionPreference.\nExiting, no indendation done."; + } + } else { + # if the file has a recognised extension, check that the file exists + unless( -e $fileName ){ + my $message = "I couldn't find $fileName, are you sure it exists?.\nNo indentation done.\nExiting."; + $logger->fatal("*$message"); + die $message; } - } - unless($fileFound){ - $self->logger("I couldn't find a match for $fileName in fileExtensionPreference (see defaultSettings.yaml)"); - foreach (@fileExtensions ){ - $self->logger("I searched for $fileName$_"); } - $self->logger("but couldn't find any of them."); - $self->logger("Consider updating fileExtensionPreference. Error: Exiting, no indendation done."); - $self->output_logfile; - die "I couldn't find a match for $fileName in fileExtensionPreference.\nExiting, no indendation done."; - } - } else { - # if the file has a recognised extension, check that the file exists - unless( -e $fileName ){ - my $message = "Error: I couldn't find $fileName, are you sure it exists?. No indentation done. Exiting."; - $self->logger($message); - $self->output_logfile; - die $message; - } - } + } # store the file extension ${$self}{fileExtension} = $ext; @@ -95,53 +96,62 @@ sub file_extension_check{ # check to see if -o switch is active if($switches{outputToFile}){ - $self->logger("Output file check",'heading'); + $logger->info("*-o switch active: output file check"); + if ($fileName eq "-" and $switches{outputToFile} =~ m/^\+/){ + $logger->info("STDIN input mode active, -o switch is removing all + symbols"); + $switches{outputToFile} =~ s/\+//g; + } # the -o file name might begin with a + symbol if($switches{outputToFile} =~ m/^\+(.*)/ and $1 ne "+"){ - $self->logger("-o switch called with + symbol at the beginning: $switches{outputToFile}"); + $logger->info("-o switch called with + symbol at the beginning: $switches{outputToFile}"); $switches{outputToFile} = ${$self}{baseName}.$1; - $self->logger("output file is now: $switches{outputToFile}"); + $logger->info("output file is now: $switches{outputToFile}"); } my $strippedFileExtension = ${$self}{fileExtension}; $strippedFileExtension =~ s/\.//; + $strippedFileExtension = "tex" if ($strippedFileExtension eq ""); # grab the name, directory, and extension of the output file my ($name, $dir, $ext) = fileparse($switches{outputToFile}, $strippedFileExtension); # if there is no extension, then add the extension from the file to be operated upon if(!$ext){ - $self->logger("-o switch called with file name without extension: $switches{outputToFile}"); + $logger->info("-o switch called with file name without extension: $switches{outputToFile}"); $switches{outputToFile} = $name.($name=~m/\.\z/ ? q() : ".").$strippedFileExtension; - $self->logger("Updated to $switches{outputToFile} as the file extension of the input file is $strippedFileExtension"); + $logger->info("Updated to $switches{outputToFile} as the file extension of the input file is $strippedFileExtension"); } # the -o file name might end with ++ in which case we wish to search for existence, # and then increment accordingly $name =~ s/\.$//; if($name =~ m/\+\+$/){ - $self->logger("-o switch called with file name ending with ++: $switches{outputToFile}"); + $logger->info("-o switch called with file name ending with ++: $switches{outputToFile}"); $name =~ s/\+\+$//; $name = ${$self}{baseName} if ($name eq ""); my $outputFileCounter = 0; my $fileName = $name.$outputFileCounter.".".$strippedFileExtension; - $self->logger("will search for exisitence and increment counter, starting with $fileName"); + $logger->info("will search for existence and increment counter, starting with $fileName"); while( -e $fileName ){ - $self->logger("$fileName exists, incrementing counter"); + $logger->info("$fileName exists, incrementing counter"); $outputFileCounter++; $fileName = $name.$outputFileCounter.".".$strippedFileExtension; } - $self->logger("$fileName does not exist, and will be the output file"); + $logger->info("$fileName does not exist, and will be the output file"); $switches{outputToFile} = $fileName; } } # read the file into the Document body my @lines; - open(MAINFILE, $fileName) or die "Could not open input file, $fileName"; - push(@lines,$_) while(); - close(MAINFILE); + if($fileName ne "-"){ + open(MAINFILE, $fileName) or die "Could not open input file, $fileName"; + push(@lines,$_) while(); + close(MAINFILE); + } else { + push(@lines,$_) while (<>) + } # the all-important step: update the body ${$self}{body} = join("",@lines); diff --git a/LatexIndent/GetYamlSettings.pm b/LatexIndent/GetYamlSettings.pm index bb0e47f2..5f86e000 100644 --- a/LatexIndent/GetYamlSettings.pm +++ b/LatexIndent/GetYamlSettings.pm @@ -20,6 +20,7 @@ use LatexIndent::Switches qw/%switches $is_m_switch_active $is_t_switch_active $ use YAML::Tiny; # interpret defaultSettings.yaml and other potential settings files use File::Basename; # to get the filename and directory path use File::HomeDir; +use Log::Log4perl qw(get_logger :levels); use Exporter qw/import/; our @EXPORT_OK = qw/readSettings modify_line_breaks_settings get_indentation_settings_for_this_object get_every_or_custom_value get_indentation_information get_object_attribute_for_indentation_settings alignment_at_ampersand_settings %masterSettings/; @@ -32,18 +33,32 @@ our %masterSettings; # previously found settings is a hash, global to this module our %previouslyFoundSettings; +# default values for align at ampersand routine +our @alignAtAmpersandInformation = ( {name=>"lookForAlignDelims",yamlname=>"delims",default=>1}, + {name=>"alignDoubleBackSlash",default=>1}, + {name=>"spacesBeforeDoubleBackSlash",default=>1}, + {name=>"multiColumnGrouping",default=>0}, + {name=>"alignRowsWithoutMaxDelims",default=>1}, + {name=>"spacesBeforeAmpersand",default=>1}, + {name=>"spacesAfterAmpersand",default=>1}, + {name=>"justification",default=>"left"}, + ); + sub readSettings{ my $self = shift; + # read the default settings $defaultSettings = YAML::Tiny->read( "$FindBin::RealBin/defaultSettings.yaml" ); - $self->logger("YAML settings read: defaultSettings.yaml",'heading'); - $self->logger("Reading defaultSettings.yaml from $FindBin::RealBin/defaultSettings.yaml"); + + # grab the logger object + my $logger = get_logger("Document"); + $logger->info("*YAML settings read: defaultSettings.yaml\nReading defaultSettings.yaml from $FindBin::RealBin/defaultSettings.yaml"); # if latexindent.exe is invoked from TeXLive, then defaultSettings.yaml won't be in # the same directory as it; we need to navigate to it if(!$defaultSettings) { $defaultSettings = YAML::Tiny->read( "$FindBin::RealBin/../../texmf-dist/scripts/latexindent/defaultSettings.yaml"); - $self->logger("Reading defaultSettings.yaml (2nd attempt, TeXLive, Windows) from $FindBin::RealBin/../../texmf-dist/scripts/latexindent/defaultSettings.yaml"); + $logger->info("Reading defaultSettings.yaml (2nd attempt, TeXLive, Windows) from $FindBin::RealBin/../../texmf-dist/scripts/latexindent/defaultSettings.yaml"); } # need to exit if we can't get defaultSettings.yaml @@ -60,7 +75,7 @@ sub readSettings{ # we'll need the home directory a lot in what follows my $homeDir = File::HomeDir->my_home; - $self->logger("YAML settings read: indentconfig.yaml or .indentconfig.yaml",'heading'); + $logger->info("*YAML settings read: indentconfig.yaml or .indentconfig.yaml") unless $switches{onlyDefault}; # get information about user settings- first check if indentconfig.yaml exists my $indentconfig = "$homeDir/indentconfig.yaml"; @@ -70,39 +85,39 @@ sub readSettings{ # messages for indentconfig.yaml and/or .indentconfig.yaml if ( -e $indentconfig and !$switches{onlyDefault}) { - $self->logger("Reading path information from $indentconfig"); + $logger->info("Reading path information from $indentconfig"); # if both indentconfig.yaml and .indentconfig.yaml exist if ( -e File::HomeDir->my_home . "/indentconfig.yaml" and -e File::HomeDir->my_home . "/.indentconfig.yaml") { - $self->logger("$homeDir/.indentconfig.yaml has been found, but $indentconfig takes priority"); + $logger->info("$homeDir/.indentconfig.yaml has been found, but $indentconfig takes priority"); } elsif ( -e File::HomeDir->my_home . "/indentconfig.yaml" ) { - $self->logger("(Alternatively $homeDir/.indentconfig.yaml can be used)"); + $logger->info("(Alternatively $homeDir/.indentconfig.yaml can be used)"); } elsif ( -e File::HomeDir->my_home . "/.indentconfig.yaml" ) { - $self->logger("(Alternatively $homeDir/indentconfig.yaml can be used)"); + $logger->info("(Alternatively $homeDir/indentconfig.yaml can be used)"); } - + # read the absolute paths from indentconfig.yaml $userSettings = YAML::Tiny->read( "$indentconfig" ); # output the contents of indentconfig to the log file - $self->logger(Dump \%{$userSettings->[0]}); - + $logger->info(Dump \%{$userSettings->[0]}); + # update the absolute paths @absPaths = @{$userSettings->[0]->{paths}}; } else { if($switches{onlyDefault}) { - $self->logger("Only default settings requested, not reading USER settings from $indentconfig"); - $self->logger("Ignoring $switches{readLocalSettings} (you used the -d switch)") if($switches{readLocalSettings}); - $self->logger("Ignoring the -y switch: $switches{yaml} (you used the -d switch)") if($switches{yaml}); + $logger->info("*-d switch active: only default settings requested"); + $logger->info("not reading USER settings from $indentconfig") if (-e $indentconfig); + $logger->info("Ignoring the -l switch: $switches{readLocalSettings} (you used the -d switch)") if($switches{readLocalSettings}); + $logger->info("Ignoring the -y switch: $switches{yaml} (you used the -d switch)") if($switches{yaml}); $switches{readLocalSettings}=0; $switches{yaml}=0; } else { # give the user instructions on where to put indentconfig.yaml or .indentconfig.yaml - $self->logger("Home directory is $homeDir (didn't find either indentconfig.yaml or .indentconfig.yaml)"); - $self->logger("To specify user settings you would put indentconfig.yaml here: $homeDir/indentconfig.yaml"); - $self->logger("Alternatively, you can use the hidden file .indentconfig.yaml as: $homeDir/.indentconfig.yaml"); + $logger->info("Home directory is $homeDir (didn't find either indentconfig.yaml or .indentconfig.yaml)\nTo specify user settings you would put indentconfig.yaml here: $homeDir/indentconfig.yaml\nAlternatively, you can use the hidden file .indentconfig.yaml as: $homeDir/.indentconfig.yaml"); } } + # local settings can be called with a + symbol, for example # -l=+myfile.yaml # -l "+ myfile.yaml" @@ -117,20 +132,20 @@ sub readSettings{ # will *only* load localSettings.yaml, and myfile.yaml will be ignored my @localSettings; - $self->logger("YAML settings read: -l switch",'heading') if $switches{readLocalSettings}; + $logger->info("*YAML settings read: -l switch") if $switches{readLocalSettings}; # remove leading, trailing, and intermediate space $switches{readLocalSettings} =~ s/^\h*//g; $switches{readLocalSettings} =~ s/\h*$//g; $switches{readLocalSettings} =~ s/\h*,\h*/,/g; if($switches{readLocalSettings} =~ m/\+/){ - $self->logger("+ found in call for -l switch: will add localSettings.yaml"); + $logger->info("+ found in call for -l switch: will add localSettings.yaml"); # + can be either at the beginning or the end, which determines if where the comma should go my $commaAtBeginning = ($switches{readLocalSettings} =~ m/^\h*\+/ ? q() : ","); my $commaAtEnd = ($switches{readLocalSettings} =~ m/^\h*\+/ ? "," : q()); $switches{readLocalSettings} =~ s/\h*\+\h*/$commaAtBeginning."localSettings.yaml".$commaAtEnd/e; - $self->logger("New value of -l switch: $switches{readLocalSettings}"); + $logger->info("New value of -l switch: $switches{readLocalSettings}"); } # local settings can be separated by , @@ -138,8 +153,9 @@ sub readSettings{ # -l = myyaml1.yaml,myyaml2.yaml # and in which case, we need to read them all if($switches{readLocalSettings} =~ m/,/){ - $self->logger("Multiple localSettings found, separated by commas:"); + $logger->info("Multiple localSettings found, separated by commas:"); @localSettings = split(/,/,$switches{readLocalSettings}); + $logger->info(join(', ',@localSettings)); } else { push(@localSettings,$switches{readLocalSettings}) if($switches{readLocalSettings}); } @@ -161,21 +177,21 @@ sub readSettings{ # check for existence and non-emptiness if ( (-e $_) and !(-z $_)) { - $self->logger("Adding $_ to YAML read paths"); + $logger->info("Adding $_ to YAML read paths"); push(@absPaths,"$_"); } elsif ( !(-e $_) ) { - $self->logger("WARNING yaml file not found: $_ not found. Proceeding without it."); + $logger->warn("*yaml file not found: $_ not found. Proceeding without it."); } } # heading for the log file - $self->logger("YAML settings, reading from the following files:",'heading') if @absPaths; + $logger->info("*YAML settings, reading from the following files:") if @absPaths; # read in the settings from each file foreach my $settings (@absPaths) { # check that the settings file exists and that it isn't empty if (-e $settings and !(-z $settings)) { - $self->logger("Reading USER settings from $settings"); + $logger->info("Reading USER settings from $settings"); $userSettings = YAML::Tiny->read( "$settings" ); # if we can read userSettings @@ -189,14 +205,14 @@ sub readSettings{ # if masterSettings already contains a *scalar* value in secondLevelKey # then we need to delete it (test-cases/headings-first.tex with indentRules1.yaml first demonstrated this) if(ref $masterSettings{$firstLevelKey}{$secondLevelKey} ne "HASH"){ - $self->logger("masterSettings{$firstLevelKey}{$secondLevelKey} currently contains a *scalar* value, but it needs to be updated with a hash (see $settings); deleting the scalar") if($is_t_switch_active); + $logger->trace("*masterSettings{$firstLevelKey}{$secondLevelKey} currently contains a *scalar* value, but it needs to be updated with a hash (see $settings); deleting the scalar") if($is_t_switch_active); delete $masterSettings{$firstLevelKey}{$secondLevelKey} ; } while(my ($thirdLevelKey,$thirdLevelValue) = each %{$secondLevelValue}) { if (ref $thirdLevelValue eq "HASH"){ # similarly for third level if (ref $masterSettings{$firstLevelKey}{$secondLevelKey}{$thirdLevelKey} ne "HASH"){ - $self->logger("masterSettings{$firstLevelKey}{$secondLevelKey}{$thirdLevelKey} currently contains a *scalar* value, but it needs to be updated with a hash (see $settings); deleting the scalar") if($is_t_switch_active); + $logger->trace("*masterSettings{$firstLevelKey}{$secondLevelKey}{$thirdLevelKey} currently contains a *scalar* value, but it needs to be updated with a hash (see $settings); deleting the scalar") if($is_t_switch_active); delete $masterSettings{$firstLevelKey}{$secondLevelKey}{$thirdLevelKey} ; } while(my ($fourthLevelKey,$fourthLevelValue) = each %{$thirdLevelValue}) { @@ -217,21 +233,21 @@ sub readSettings{ # output settings to $logfile if($masterSettings{logFilePreferences}{showEveryYamlRead}){ - $self->logger(Dump \%{$userSettings->[0]}); + $logger->info(Dump \%{$userSettings->[0]}); } else { - $self->logger("Not showing settings in the log file (see showEveryYamlRead and showAmalgamatedSettings)."); + $logger->info("Not showing settings in the log file (see showEveryYamlRead and showAmalgamatedSettings)."); } } else { # otherwise print a warning that we can not read userSettings.yaml - $self->logger("WARNING $settings contains invalid yaml format- not reading from it"); + $logger->warn("*$settings contains invalid yaml format- not reading from it"); } } else { # otherwise keep going, but put a warning in the log file - $self->logger("WARNING: $homeDir/indentconfig.yaml"); + $logger->warn("*$homeDir/indentconfig.yaml"); if (-z $settings) { - $self->logger("specifies $settings but this file is EMPTY -- not reading from it"); + $logger->info("specifies $settings but this file is EMPTY -- not reading from it"); } else { - $self->logger("specifies $settings but this file does not exist - unable to read settings from this file"); + $logger->info("specifies $settings but this file does not exist - unable to read settings from this file"); } } } @@ -239,16 +255,16 @@ sub readSettings{ # read settings from -y|--yaml switch if($switches{yaml}){ # report to log file - $self->logger("YAML settings read: -y switch",'heading'); + $logger->info("*YAML settings read: -y switch"); # remove any horizontal space before or after , OR : OR ; or at the beginning or end of the switch value - $switches{yaml} =~ s/\h*(,|:|;)\h*/$1/g; + $switches{yaml} =~ s/\h*(,|(?logger("Sub-field detected (; present) and the root is: $root") if $is_t_switch_active; + $logger->trace("*Sub-field detected (; present) and the root is: $root") if $is_t_switch_active; # now we need to attach the $root back together with any subfields foreach(@subfield){ @@ -322,18 +338,22 @@ sub readSettings{ # increment the counter $settingsCounter++; } - $self->logger("-y switch value interpreted as: ".join(',',@yamlSettings)); + $logger->info("-y switch value interpreted as: ".join(',',@yamlSettings)); } } # loop through each of the settings specified in the -y switch foreach(@yamlSettings){ # split each value at semi-colon - my (@keysValues) = split(/:/,$_); + my (@keysValues) = split(/(?logger("Updating masterSettings with $key: $value"); + $logger->info("Updating masterSettings with $key: $value"); $masterSettings{$key} = $value; } elsif(scalar(@keysValues) == 3){ # for example, -y="indentRules: one: '\t\t\t\t'" my $parent = $keysValues[0]; my $child = $keysValues[1]; - $self->logger("Updating masterSettings with $parent: $child: $value"); + $logger->info("Updating masterSettings with $parent: $child: $value"); $masterSettings{$parent}{$child} = $value; } elsif(scalar(@keysValues) == 4){ # for example, -y='modifyLineBreaks : environments: EndStartsOnOwnLine:3' -m my $parent = $keysValues[0]; my $child = $keysValues[1]; my $grandchild = $keysValues[2]; - $self->logger("Updating masterSettings with $parent: $child: $grandchild: $value"); + $logger->info("Updating masterSettings with $parent: $child: $grandchild: $value"); $masterSettings{$parent}{$child}{$grandchild} = $value; } elsif(scalar(@keysValues) == 5){ # for example, -y='modifyLineBreaks : environments: one: EndStartsOnOwnLine:3' -m @@ -369,7 +389,7 @@ sub readSettings{ my $child = $keysValues[1]; my $grandchild = $keysValues[2]; my $greatgrandchild = $keysValues[3]; - $self->logger("Updating masterSettings with $parent: $child: $grandchild: $greatgrandchild: $value"); + $logger->info("Updating masterSettings with $parent: $child: $grandchild: $greatgrandchild: $value"); $masterSettings{$parent}{$child}{$grandchild}{$greatgrandchild} = $value; } } @@ -379,8 +399,8 @@ sub readSettings{ # which details the overall state of the settings modified # from the default in various user files if($masterSettings{logFilePreferences}{showAmalgamatedSettings}){ - $self->logger("Amalgamated/overall settings to be used:",'heading'); - $self->logger(Dump \%masterSettings); + $logger->info("Amalgamated/overall settings to be used:"); + $logger->info(Dump \%masterSettings); } return; @@ -392,12 +412,15 @@ sub get_indentation_settings_for_this_object{ # create a name for previously found settings my $storageName = ${$self}{name}.${$self}{modifyLineBreaksYamlName}.(defined ${$self}{storageNameAppend}?${$self}{storageNameAppend}:q()); + # grab the logging object + my $logger = get_logger("Document"); + # check for storage of repeated objects if ($previouslyFoundSettings{$storageName}){ - $self->logger("Using stored settings for $storageName") if($is_t_switch_active); + $logger->trace("*Using stored settings for $storageName") if($is_t_switch_active); } else { my $name = ${$self}{name}; - $self->logger("Storing settings for $storageName") if($is_t_switch_active); + $logger->trace("Storing settings for $storageName") if($is_t_switch_active); # check for noAdditionalIndent and indentRules # otherwise use defaultIndent @@ -420,11 +443,9 @@ sub get_indentation_settings_for_this_object{ ); # don't forget alignment settings! - ${${previouslyFoundSettings}{$storageName}}{lookForAlignDelims} = ${$self}{lookForAlignDelims} if(defined ${$self}{lookForAlignDelims}); - ${${previouslyFoundSettings}{$storageName}}{alignDoubleBackSlash} = ${$self}{alignDoubleBackSlash} if(defined ${$self}{alignDoubleBackSlash}); - ${${previouslyFoundSettings}{$storageName}}{spacesBeforeDoubleBackSlash} = ${$self}{spacesBeforeDoubleBackSlash} if(defined ${$self}{spacesBeforeDoubleBackSlash}); - ${${previouslyFoundSettings}{$storageName}}{multiColumnGrouping} = ${$self}{multiColumnGrouping} if(defined ${$self}{multiColumnGrouping}); - ${${previouslyFoundSettings}{$storageName}}{alignRowsWithoutMaxDelims} = ${$self}{alignRowsWithoutMaxDelims} if(defined ${$self}{alignRowsWithoutMaxDelims}); + foreach (@alignAtAmpersandInformation){ + ${${previouslyFoundSettings}{$storageName}}{${$_}{name}} = ${$self}{${$_}{name}} if(defined ${$self}{${$_}{name}}); + } # some objects, e.g ifElseFi, can have extra assignments, e.g ElseStartsOnOwnLine # these need to be stored as well! @@ -432,6 +453,10 @@ sub get_indentation_settings_for_this_object{ ${${previouslyFoundSettings}{$storageName}}{$_} = ${$self}{$_}; } + # log file information + $logger->trace("Settings for $name (stored for future use):") if $is_tt_switch_active; + $logger->trace(Dump \%{${previouslyFoundSettings}{$storageName}}) if $is_tt_switch_active; + } # append indentation settings to the current object @@ -461,17 +486,25 @@ sub alignment_at_ampersand_settings{ return unless ${$masterSettings{lookForAlignDelims}}{$name}; if(ref ${$masterSettings{lookForAlignDelims}}{$name} eq "HASH"){ - ${$self}{lookForAlignDelims} = (defined ${${$masterSettings{lookForAlignDelims}}{$name}}{delims} ) ? ${${$masterSettings{lookForAlignDelims}}{$name}}{delims} : 1; - ${$self}{alignDoubleBackSlash} = (defined ${${$masterSettings{lookForAlignDelims}}{$name}}{alignDoubleBackSlash} ) ? ${${$masterSettings{lookForAlignDelims}}{$name}}{alignDoubleBackSlash} : 1; - ${$self}{spacesBeforeDoubleBackSlash} = (defined ${${$masterSettings{lookForAlignDelims}}{$name}}{spacesBeforeDoubleBackSlash} ) ? ${${$masterSettings{lookForAlignDelims}}{$name}}{spacesBeforeDoubleBackSlash} : -1; - ${$self}{multiColumnGrouping} = (defined ${${$masterSettings{lookForAlignDelims}}{$name}}{multiColumnGrouping} ) ? ${${$masterSettings{lookForAlignDelims}}{$name}}{multiColumnGrouping} : 0; - ${$self}{alignRowsWithoutMaxDelims} = (defined ${${$masterSettings{lookForAlignDelims}}{$name}}{alignRowsWithoutMaxDelims} ) ? ${${$masterSettings{lookForAlignDelims}}{$name}}{alignRowsWithoutMaxDelims} : 1; + # specified as a hash, e.g + # + # lookForAlignDelims: + # tabular: + # delims: 1 + # alignDoubleBackSlash: 1 + # spacesBeforeDoubleBackSlash: 2 + foreach (@alignAtAmpersandInformation){ + my $yamlname = (defined ${$_}{yamlname} ? ${$_}{yamlname}: ${$_}{name}); + ${$self}{${$_}{name}} = (defined ${${$masterSettings{lookForAlignDelims}}{$name}}{$yamlname} ) ? ${${$masterSettings{lookForAlignDelims}}{$name}}{$yamlname} : ${$_}{default}; + } } else { - ${$self}{lookForAlignDelims} = 1; - ${$self}{alignDoubleBackSlash} = 1; - ${$self}{spacesBeforeDoubleBackSlash} = -1; - ${$self}{multiColumnGrouping} = 0; - ${$self}{alignRowsWithoutMaxDelims} = 1; + # specified as a scalar, e.g + # + # lookForAlignDelims: + # tabular: 1 + foreach (@alignAtAmpersandInformation){ + ${$self}{${$_}{name}} = ${$_}{default}; + } } return; } @@ -482,8 +515,11 @@ sub modify_line_breaks_settings{ my $self = shift; + # grab the logging object + my $logger = get_logger("Document"); + # details to the log file - $self->logger("-m modifylinebreaks switch active, looking for settings for ${$self}{name} ",'heading') if $is_t_switch_active; + $logger->trace("*-m modifylinebreaks switch active, looking for settings for ${$self}{name} ") if $is_t_switch_active; # some objects, e.g ifElseFi, can have extra assignments, e.g ElseStartsOnOwnLine my @toBeAssignedTo = ${$self}{additionalAssignments} ? @{${$self}{additionalAssignments}} : (); @@ -522,11 +558,11 @@ sub modify_line_breaks_settings{ my $name = ($YamlName =~ m/Arguments/) ? ${$self}{parent} : ${$self}{name}; if(ref ${$masterSettings{modifyLineBreaks}{removeParagraphLineBreaks}}{$YamlName} eq "HASH"){ - $self->logger("$YamlName specified with fields in removeParagraphLineBreaks, looking for $name") if $is_t_switch_active; + $logger->trace("*$YamlName specified with fields in removeParagraphLineBreaks, looking for $name") if $is_t_switch_active; ${$self}{removeParagraphLineBreaks} = ${${$masterSettings{modifyLineBreaks}{removeParagraphLineBreaks}}{$YamlName}}{$name}||0; } else { if(defined ${$masterSettings{modifyLineBreaks}{removeParagraphLineBreaks}}{$YamlName}){ - $self->logger("$YamlName specified with just a number in removeParagraphLineBreaks ${$masterSettings{modifyLineBreaks}{removeParagraphLineBreaks}}{$YamlName}") if $is_t_switch_active; + $logger->trace("*$YamlName specified with just a number in removeParagraphLineBreaks ${$masterSettings{modifyLineBreaks}{removeParagraphLineBreaks}}{$YamlName}") if $is_t_switch_active; ${$self}{removeParagraphLineBreaks} = ${$masterSettings{modifyLineBreaks}{removeParagraphLineBreaks}}{$YamlName}; } } @@ -540,9 +576,12 @@ sub get_every_or_custom_value{ my $toBeAssignedTo = $input{toBeAssignedTo}; my $toBeAssignedToAlias = $input{toBeAssignedToAlias}; + # grab the logging object + my $logger = get_logger("Document"); + # alias if(${$self}{aliases}{$toBeAssignedTo}){ - $self->logger("aliased $toBeAssignedTo using ${$self}{aliases}{$toBeAssignedTo}") if($is_t_switch_active); + $logger->trace("aliased $toBeAssignedTo using ${$self}{aliases}{$toBeAssignedTo}") if($is_t_switch_active); } # name of the object in the modifyLineBreaks yaml (e.g environments, ifElseFi, etc) @@ -557,12 +596,12 @@ sub get_every_or_custom_value{ # check for the *custom* value if (defined $customValue){ - $self->logger("$name: $toBeAssignedToAlias=$customValue, (*custom* value) adjusting $toBeAssignedTo") if($is_t_switch_active); + $logger->trace("$name: $toBeAssignedToAlias=$customValue, (*custom* value) adjusting $toBeAssignedTo") if($is_t_switch_active); ${$self}{$toBeAssignedTo} = $customValue !=0 ? $customValue : undef; } else { # check for the *every* value if (defined $everyValue and $everyValue != 0){ - $self->logger("$name: $toBeAssignedToAlias=$everyValue, (*every* value) adjusting $toBeAssignedTo") if($is_t_switch_active); + $logger->trace("$name: $toBeAssignedToAlias=$everyValue, (*every* value) adjusting $toBeAssignedTo") if($is_t_switch_active); ${$self}{$toBeAssignedTo} = $everyValue; } } @@ -619,24 +658,27 @@ sub get_indentation_information{ # if the YamlName is not optionalArguments, mandatoryArguments, heading (possibly others) then assume we're looking for 'body' my $YamlName = $self->get_object_attribute_for_indentation_settings; + # grab the logging object + my $logger = get_logger("Document"); + my $indentationInformation; foreach my $indentationAbout ("noAdditionalIndent","indentRules"){ # check that the 'thing' is defined if(defined ${$masterSettings{$indentationAbout}}{$name}){ if(ref ${$masterSettings{$indentationAbout}}{$name} eq "HASH"){ - $self->logger("$indentationAbout indentation specified with multiple fields for $name, searching for $name: $YamlName (see $indentationAbout)") if $is_t_switch_active ; + $logger->trace("$indentationAbout indentation specified with multiple fields for $name, searching for $name: $YamlName (see $indentationAbout)") if $is_t_switch_active ; $indentationInformation = ${${$masterSettings{$indentationAbout}}{$name}}{$YamlName}; } else { $indentationInformation = ${$masterSettings{$indentationAbout}}{$name}; - $self->logger("$indentationAbout indentation specified for $name (for *all* fields, body, optionalArguments, mandatoryArguments, afterHeading), using '$indentationInformation' (see $indentationAbout)") if $is_t_switch_active ; + $logger->trace("$indentationAbout indentation specified for $name (for *all* fields, body, optionalArguments, mandatoryArguments, afterHeading), using '$indentationInformation' (see $indentationAbout)") if $is_t_switch_active ; } # return, after performing an integrity check if(defined $indentationInformation){ if($indentationAbout eq "noAdditionalIndent" and $indentationInformation == 1){ - $self->logger("Found! Using '' (see $indentationAbout)") if $is_t_switch_active; + $logger->trace("Found! Using '' (see $indentationAbout)") if $is_t_switch_active; return q(); } elsif($indentationAbout eq "indentRules" and $indentationInformation=~m/^\h*$/){ - $self->logger("Found! Using '$indentationInformation' (see $indentationAbout)") if $is_t_switch_active; + $logger->trace("Found! Using '$indentationInformation' (see $indentationAbout)") if $is_t_switch_active; return $indentationInformation ; } } @@ -651,20 +693,20 @@ sub get_indentation_information{ my $globalInformation = $indentationAbout."Global"; next if(!(defined ${$masterSettings{$globalInformation}}{$YamlName})); if( ($globalInformation eq "noAdditionalIndentGlobal") and ${$masterSettings{$globalInformation}}{$YamlName}==1){ - $self->logger("$globalInformation specified for $YamlName (see $globalInformation)") if $is_t_switch_active; + $logger->trace("$globalInformation specified for $YamlName (see $globalInformation)") if $is_t_switch_active; return q(); } elsif($globalInformation eq "indentRulesGlobal") { if(${$masterSettings{$globalInformation}}{$YamlName}=~m/^\h*$/){ - $self->logger("$globalInformation specified for $YamlName (see $globalInformation)") if $is_t_switch_active; + $logger->trace("$globalInformation specified for $YamlName (see $globalInformation)") if $is_t_switch_active; return ${$masterSettings{$globalInformation}}{$YamlName}; } else { - $self->logger("$globalInformation specified (${$masterSettings{$globalInformation}}{$YamlName}) for $YamlName, but it needs to only contain horizontal space -- I'm ignoring this one") if $is_t_switch_active; + $logger->trace("$globalInformation specified (${$masterSettings{$globalInformation}}{$YamlName}) for $YamlName, but it needs to only contain horizontal space -- I'm ignoring this one") if $is_t_switch_active; } } } # return defaultIndent, by default - $self->logger("Using defaultIndent for $name") if $is_t_switch_active; + $logger->trace("Using defaultIndent for $name") if $is_t_switch_active; return $masterSettings{defaultIndent}; } diff --git a/LatexIndent/Heading.pm b/LatexIndent/Heading.pm index 9a2f7187..3dca1b7e 100644 --- a/LatexIndent/Heading.pm +++ b/LatexIndent/Heading.pm @@ -20,6 +20,7 @@ use LatexIndent::Tokens qw/%tokens/; use LatexIndent::Switches qw/$is_m_switch_active $is_t_switch_active $is_tt_switch_active/; use LatexIndent::TrailingComments qw/$trailingCommentRegExp/; use LatexIndent::GetYamlSettings qw/%masterSettings/; +use LatexIndent::LogFile qw/$logger/; use Data::Dumper; use Exporter qw/import/; our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321 @@ -35,20 +36,20 @@ sub construct_headings_levels{ my %headingsLevels = %{$masterSettings{indentAfterHeadings}}; # output to log file - $self->logger("Constructing headings reg exp for example, chapter, section, etc (see indentAfterThisHeading)") if $is_t_switch_active ; + $logger->trace("*Constructing headings reg exp for example, chapter, section, etc (see indentAfterThisHeading)") if $is_t_switch_active ; # delete the values that have indentAfterThisHeading set to 0 while( my ($headingName,$headingInfo)= each %headingsLevels){ if(!${$headingsLevels{$headingName}}{indentAfterThisHeading}){ - $self->logger("Not indenting after $headingName (see indentAfterThisHeading)",'heading') if $is_t_switch_active; + $logger->trace("Not indenting after $headingName (see indentAfterThisHeading)") if $is_t_switch_active; delete $headingsLevels{$headingName}; } else { - # *all heading* regexp, remembering put starred headings at the front of the regexp + # *all heading* regexp, remembering to put starred headings at the front of the regexp if($headingName =~ m/\*/){ - $self->logger("Putting $headingName at the beginning of the allHeadings regexp, as it contains a *") if $is_t_switch_active ; + $logger->trace("Putting $headingName at the beginning of the allHeadings regexp, as it contains a *") if $is_t_switch_active ; $allHeadingsRegexp = $headingName.($allHeadingsRegexp eq '' ?q():"|$allHeadingsRegexp"); } else { - $self->logger("Putting $headingName at the END of the allHeadings regexp, as it contains a *") if $is_t_switch_active ; + $logger->trace("Putting $headingName at the END of the allHeadings regexp") if $is_t_switch_active ; $allHeadingsRegexp .= ($allHeadingsRegexp eq '' ?q():"|").$headingName ; } } @@ -63,8 +64,8 @@ sub construct_headings_levels{ # it could be that @sortedByLevels is empty; return if !@sortedByLevels; - $self->logger("All headings regexp: $allHeadingsRegexp",'heading') if $is_t_switch_active; - $self->logger("Now to construct headings regexp for each level:",'heading') if $is_t_switch_active; + $logger->trace("*All headings regexp: $allHeadingsRegexp") if $is_tt_switch_active; + $logger->trace("*Now to construct headings regexp for each level:") if $is_t_switch_active; # loop through the levels, and create a regexp for each (min and max values are the first and last values respectively from sortedByLevels) for(my $i = ${$headingsLevels{$sortedByLevels[0]}}{level}; $i <= ${$headingsLevels{$sortedByLevels[-1]}}{level}; $i++ ){ @@ -75,10 +76,10 @@ sub construct_headings_levels{ foreach(@tmp){ # put starred headings at the front of the regexp if($_ =~ m/\*/){ - $self->logger("Putting $_ at the beginning of this regexp, as it contains a *") if $is_t_switch_active; + $logger->trace("Putting $_ at the beginning of this regexp (level $i), as it contains a *") if $is_t_switch_active; $headingsAtThisLevel = $_.($headingsAtThisLevel eq '' ?q():"|$headingsAtThisLevel"); } else { - $self->logger("Putting $_ at the END of this regexp, as it contains a *") if $is_t_switch_active; + $logger->trace("Putting $_ at the END of this regexp (level $i)") if $is_t_switch_active; $headingsAtThisLevel .= ($headingsAtThisLevel eq '' ?q():"|").$_ ; } } @@ -86,7 +87,7 @@ sub construct_headings_levels{ # make the stars escaped correctly $headingsAtThisLevel =~ s/\*/\\\*/g; push(@headingsRegexpArray,$headingsAtThisLevel); - $self->logger("Heading level regexp for level $i will contain: $headingsAtThisLevel") if $is_t_switch_active; + $logger->trace("Heading level regexp for level $i will contain: $headingsAtThisLevel") if $is_t_switch_active; } } } @@ -99,7 +100,7 @@ sub find_heading{ my $self = shift; # otherwise loop through the headings regexp - $self->logger("Searching for headings ") if $is_t_switch_active; + $logger->trace("*Searching ${$self}{name} for headings ") if $is_t_switch_active; # loop through each headings match; note that we need to # do it in *reverse* so as to ensure that the lower level headings get matched first of all @@ -120,7 +121,7 @@ sub find_heading{ while(${$self}{body} =~ m/$headingRegExp/){ # log file output - $self->logger("heading found: $2",'heading'); + $logger->trace("heading found: $2") if $is_t_switch_active; ${$self}{body} =~ s/ $headingRegExp @@ -154,7 +155,7 @@ sub get_replacement_text{ my $self = shift; # the replacement text for a heading (chapter, section, etc) needs to put the trailing part back in - $self->logger("Custom replacement text routine for heading ${$self}{name}"); + $logger->trace("Custom replacement text routine for ${$self}{name}") if $is_t_switch_active; ${$self}{replacementText} = ${$self}{id}.${$self}{afterbit}; delete ${$self}{afterbit}; } @@ -209,15 +210,15 @@ sub tasks_particular_to_each_object{ # # then we need to transfer this information to the heading object if($is_m_switch_active){ - $self->logger("Searching for linebreak preferences immediately infront of ${$self}{parent}",'heading'); + $logger->trace("Searching for linebreak preferences immediately infront of ${$self}{parent}") if $is_t_switch_active; foreach(@{${$self}{children}}){ if(${$_}{name} eq ${$self}{parent}){ - $self->logger("Named child found: ${$_}{name}"); + $logger->trace("Named child found: ${$_}{name}") if $is_t_switch_active; if(defined ${$_}{BeginStartsOnOwnLine}){ - $self->logger("Transferring information from ${$_}{id} (${$_}{name}) to ${$self}{id} (${$self}{name}) for BeginStartsOnOwnLine"); + $logger->trace("Transferring information from ${$_}{id} (${$_}{name}) to ${$self}{id} (${$self}{name}) for BeginStartsOnOwnLine") if $is_t_switch_active; ${$self}{BeginStartsOnOwnLine} = ${$_}{BeginStartsOnOwnLine}; } else { - $self->logger("No information found in ${$_}{name} for BeginStartsOnOwnLine"); + $logger->trace("No information found in ${$_}{name} for BeginStartsOnOwnLine") if $is_t_switch_active; } last; } @@ -235,7 +236,7 @@ sub add_surrounding_indentation_to_begin_statement{ # but some (e.g HEADING) have their own method my $self = shift; - $self->logger("Adding surrounding indentation after (empty, by design!) begin statement of ${$self}{name} (${$self}{id})"); + $logger->trace("Adding surrounding indentation after (empty, by design!) begin statement of ${$self}{name} (${$self}{id})") if $is_t_switch_active; ${$self}{begin} .= ${$self}{surroundingIndentation}; # add indentation } diff --git a/LatexIndent/HiddenChildren.pm b/LatexIndent/HiddenChildren.pm index 594e7dbd..af7d5138 100644 --- a/LatexIndent/HiddenChildren.pm +++ b/LatexIndent/HiddenChildren.pm @@ -18,6 +18,7 @@ use strict; use warnings; use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/; use LatexIndent::Tokens qw/%tokens/; +use LatexIndent::LogFile qw/$logger/; use Data::Dumper; use Exporter qw/import/; our @EXPORT_OK = qw/find_surrounding_indentation_for_children update_family_tree get_family_tree check_for_hidden_children %familyTree/; @@ -71,23 +72,23 @@ sub find_surrounding_indentation_for_children{ my $self = shift; # output to logfile - $self->logger("FamilyTree before update:",'heading') if $is_t_switch_active; - $self->logger(Dumper(\%familyTree)) if($is_t_switch_active); + $logger->trace("*FamilyTree before update:") if $is_tt_switch_active; + $logger->trace(Dumper(\%familyTree)) if($is_tt_switch_active); # update the family tree with ancestors $self->update_family_tree; # output information to the logfile - $self->logger("FamilyTree after update:",'heading') if $is_t_switch_active; - $self->logger(Dumper(\%familyTree)) if($is_t_switch_active); + $logger->trace("*FamilyTree after update:") if $is_tt_switch_active; + $logger->trace(Dumper(\%familyTree)) if($is_tt_switch_active); while( my ($idToSearch,$ancestorToSearch) = each %familyTree){ - $self->logger("Hidden child ID: ,$idToSearch, here are its ancestors:",'heading') if $is_t_switch_active; + $logger->trace("*Hidden child ID: ,$idToSearch, here are its ancestors:") if $is_t_switch_active; foreach(@{${$ancestorToSearch}{ancestors}}){ - $self->logger("ID: ${$_}{ancestorID}") if($is_t_switch_active); + $logger->trace("ID: ${$_}{ancestorID}") if($is_t_switch_active); my $tmpIndentation = ref(${$_}{ancestorIndentation}) eq 'SCALAR'?${${$_}{ancestorIndentation}}:${$_}{ancestorIndentation}; $tmpIndentation = $tmpIndentation ? $tmpIndentation : q(); - $self->logger("indentation: '$tmpIndentation'") if($is_t_switch_active); + $logger->trace("indentation: '$tmpIndentation'") if($is_t_switch_active); } } @@ -98,19 +99,19 @@ sub update_family_tree{ my $self = shift; # loop through the hash - $self->logger("Updating FamilyTree...",'heading') if $is_t_switch_active; + $logger->trace("*Updating FamilyTree...") if $is_t_switch_active; while( my ($idToSearch,$ancestorToSearch)= each %familyTree){ foreach(@{${$ancestorToSearch}{ancestors}}){ my $ancestorID = ${$_}{ancestorID}; - $self->logger("current ID: $idToSearch, ancestor: $ancestorID") if($is_t_switch_active); + $logger->trace("current ID: $idToSearch, ancestor: $ancestorID") if($is_t_switch_active); if($familyTree{$ancestorID}){ - $self->logger("$ancestorID is a key within familyTree, grabbing its ancestors") if($is_t_switch_active); + $logger->trace("$ancestorID is a key within familyTree, grabbing its ancestors") if($is_t_switch_active); my $naturalAncestors = q(); foreach(@{${$familyTree{$idToSearch}}{ancestors}}){ $naturalAncestors .= "---".${$_}{ancestorID} if(${$_}{type} eq "natural"); } foreach(@{${$familyTree{$ancestorID}}{ancestors}}){ - $self->logger("ancestor of *hidden* child: ${$_}{ancestorID}") if($is_t_switch_active); + $logger->trace("ancestor of *hidden* child: ${$_}{ancestorID}") if($is_t_switch_active); my $newAncestorId = ${$_}{ancestorID}; my $type; if($naturalAncestors =~ m/$ancestorID/){ @@ -126,7 +127,7 @@ sub update_family_tree{ foreach(@{${$familyTree{$idToSearch}}{ancestors}}){ $naturalAncestors .= "---".${$_}{ancestorID} if(${$_}{type} eq "natural"); } - $self->logger("natural ancestors of $ancestorID: $naturalAncestors") if($is_t_switch_active); + $logger->trace("natural ancestors of $ancestorID: $naturalAncestors") if($is_t_switch_active); foreach(@{${$allChildren{$ancestorID}}{ancestors}}){ my $newAncestorId = ${$_}{ancestorID}; my $type; @@ -137,7 +138,7 @@ sub update_family_tree{ } my $matched = grep { $_->{ancestorID} eq $newAncestorId } @{${$familyTree{$idToSearch}}{ancestors}}; unless($matched){ - $self->logger("ancestor of UNHIDDEN child: ${$_}{ancestorID}") if($is_t_switch_active); + $logger->trace("ancestor of UNHIDDEN child: ${$_}{ancestorID}") if($is_t_switch_active); push(@{${$familyTree{$idToSearch}}{ancestors}},{ancestorID=>${$_}{ancestorID},ancestorIndentation=>${$_}{ancestorIndentation},type=>$type}); } } @@ -158,8 +159,8 @@ sub check_for_hidden_children{ my @matched = (${$self}{body} =~ /((?:$tokens{ifelsefiSpecial})?$tokens{beginOfToken}.[-a-z0-9]+?$tokens{endOfToken})/ig); # log file - $self->logger("Hidden children check") if $is_t_switch_active; - $self->logger(join("|",@matched)) if $is_t_switch_active; + $logger->trace("*Hidden children check") if $is_t_switch_active; + $logger->trace(join("|",@matched)) if $is_t_switch_active; my $naturalAncestors = ${$self}{naturalAncestors}; @@ -171,7 +172,7 @@ sub check_for_hidden_children{ my $newAncestorId = ${$_}{ancestorID}; unless (grep { $_->{ancestorID} eq $newAncestorId } @{${$familyTree{$match}}{ancestors}}){ my $type = ($naturalAncestors =~ m/${$_}{ancestorID}/ ) ? "natural" : "adopted"; - $self->logger("Adding ${$_}{ancestorID} to the $type family tree of $match") if($is_t_switch_active); + $logger->trace("Adding ${$_}{ancestorID} to the $type family tree of $match") if($is_t_switch_active); push(@{$familyTree{$match}{ancestors}},{ancestorID=>${$_}{ancestorID},ancestorIndentation=>${$_}{ancestorIndentation},type=>$type}); } } @@ -180,7 +181,7 @@ sub check_for_hidden_children{ # update the family tree with self unless (grep { $_->{ancestorID} eq ${$self}{id}} @{${$familyTree{$match}}{ancestors}}){ my $type = ($naturalAncestors =~ m/${$self}{id}/ ) ? "natural" : "adopted"; - $self->logger("Adding ${$self}{id} to the $type family tree of hiddenChild $match") if($is_t_switch_active); + $logger->trace("Adding ${$self}{id} to the $type family tree of hiddenChild $match") if($is_t_switch_active); push(@{$familyTree{$match}{ancestors}},{ancestorID=>${$self}{id},ancestorIndentation=>${$self}{indentation},type=>$type}); } } diff --git a/LatexIndent/HorizontalWhiteSpace.pm b/LatexIndent/HorizontalWhiteSpace.pm index 09e96ecc..9c5a04e2 100644 --- a/LatexIndent/HorizontalWhiteSpace.pm +++ b/LatexIndent/HorizontalWhiteSpace.pm @@ -18,6 +18,7 @@ use strict; use warnings; use LatexIndent::GetYamlSettings qw/%masterSettings/; use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/; +use LatexIndent::LogFile qw/$logger/; use Exporter qw/import/; our @EXPORT_OK = qw/remove_trailing_whitespace remove_leading_space/; @@ -25,10 +26,12 @@ sub remove_trailing_whitespace{ my $self = shift; my %input = @_; + $logger->trace("*Horizontal space removal routine") if $is_t_switch_active; + # removeTrailingWhitespace can be either a hash or a scalar, but if # it's a scalar, we need to fix it if(ref($masterSettings{removeTrailingWhitespace}) ne 'HASH'){ - $self->logger("removeTrailingWhitespace specified as scalar, will update it to be a hash",'heading') if $is_t_switch_active; + $logger->trace("removeTrailingWhitespace specified as scalar, will update it to be a hash") if $is_t_switch_active; # grab the value my $removeTWS = $masterSettings{removeTrailingWhitespace}; @@ -38,17 +41,17 @@ sub remove_trailing_whitespace{ # redefine it as a hash ${$masterSettings{removeTrailingWhitespace}}{beforeProcessing} = $removeTWS; ${$masterSettings{removeTrailingWhitespace}}{afterProcessing} = $removeTWS; - $self->logger("removeTrailingWhitespace: beforeProcessing is now $removeTWS") if $is_t_switch_active; - $self->logger("removeTrailingWhitespace: afterProcessing is now $removeTWS") if $is_t_switch_active; + $logger->trace("removeTrailingWhitespace: beforeProcessing is now $removeTWS") if $is_t_switch_active; + $logger->trace("removeTrailingWhitespace: afterProcessing is now $removeTWS") if $is_t_switch_active; } # this method can be called before the indendation, and after, depending upon the input if($input{when} eq "before"){ return unless(${$masterSettings{removeTrailingWhitespace}}{beforeProcessing}); - $self->logger("Removing trailing white space *before* the document is processed (see removeTrailingWhitespace: beforeProcessing)",'heading') if $is_t_switch_active; + $logger->trace("Removing trailing white space *before* the document is processed (see removeTrailingWhitespace: beforeProcessing)") if $is_t_switch_active; } elsif($input{when} eq "after"){ return unless(${$masterSettings{removeTrailingWhitespace}}{afterProcessing}); - $self->logger("Removing trailing white space *after* the document is processed (see removeTrailingWhitespace: afterProcessing)",'heading') if $is_t_switch_active; + $logger->trace("Removing trailing white space *after* the document is processed (see removeTrailingWhitespace: afterProcessing)") if $is_t_switch_active; } else { return; } @@ -58,14 +61,11 @@ sub remove_trailing_whitespace{ $ # up to the end of a line //xsmg; - $self->logger("Processed body, *$input{when}* indentation (${$self}{name}):") if($is_t_switch_active); - $self->logger(${$self}{body}) if($is_t_switch_active); - } sub remove_leading_space{ my $self = shift; - $self->logger("Removing leading space from ${$self}{name} (verbatim/noindentblock already accounted for)",'heading') if $is_t_switch_active; + $logger->trace("*Removing leading space from ${$self}{name} (verbatim/noindentblock already accounted for)") if $is_t_switch_active; ${$self}{body} =~ s/ ( ^ # beginning of the line diff --git a/LatexIndent/IfElseFi.pm b/LatexIndent/IfElseFi.pm index 5e4040d5..1a0529d3 100644 --- a/LatexIndent/IfElseFi.pm +++ b/LatexIndent/IfElseFi.pm @@ -19,6 +19,7 @@ use warnings; use LatexIndent::Tokens qw/%tokens/; use LatexIndent::TrailingComments qw/$trailingCommentRegExp/; use LatexIndent::Switches qw/$is_m_switch_active $is_t_switch_active $is_tt_switch_active/; +use LatexIndent::LogFile qw/$logger/; use Data::Dumper; use Exporter qw/import/; our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321 @@ -62,9 +63,6 @@ sub find_ifelsefi{ ${$self}{body} =~ s/ $ifElseFiRegExp(\h*)($trailingCommentRegExp)? / - # log file output - $self->logger("IfElseFi found: $2",'heading')if $is_t_switch_active; - # create a new IfElseFi object my $ifElseFi = LatexIndent::IfElseFi->new(begin=>$1.(($4 eq "\n" and !$3)?"\n":q()), name=>$2, @@ -88,6 +86,9 @@ sub find_ifelsefi{ endImmediatelyFollowedByComment=>$9?0:($11?1:0), horizontalTrailingSpace=>$8?$8:q(), ); + # log file output + $logger->trace("*IfElseFi found: $2")if $is_t_switch_active; + # the settings and storage of most objects has a lot in common $self->get_settings_and_store_new_object($ifElseFi); ${@{${$self}{children}}[-1]}{replacementText}.($10?$10:q()).($11?$11:q()); @@ -104,7 +105,7 @@ sub post_indentation_check{ and !(${$self}{body} =~ m/^\h*\\else/s and ${$self}{linebreaksAtEnd}{begin}==0) ){ - $self->logger("Adding surrounding indentation to \\else statement ('${$self}{surroundingIndentation}')") if $is_t_switch_active; + $logger->trace("*Adding surrounding indentation to \\else statement ('${$self}{surroundingIndentation}')") if $is_t_switch_active; ${$self}{body} =~ s/^\h*\\else/${$self}{surroundingIndentation}\\else/sm; } return; @@ -155,10 +156,10 @@ sub wrap_up_statement{ # text # after: # \fitext - $self->logger("Adding a single space after \\fi statement (otherwise \\fi can be comined with next line of text in an unwanted way)",'heading') if $is_t_switch_active; + $logger->trace("*Adding a single space after \\fi statement (otherwise \\fi can be comined with next line of text in an unwanted way)") if $is_t_switch_active; ${$self}{end} =${$self}{end}." "; } - $self->logger("Finished indenting ${$self}{name}",'heading') if $is_t_switch_active; + $logger->trace("*Finished indenting ${$self}{name}") if $is_t_switch_active; return $self; } diff --git a/LatexIndent/Indent.pm b/LatexIndent/Indent.pm index c9d05269..57bcd225 100644 --- a/LatexIndent/Indent.pm +++ b/LatexIndent/Indent.pm @@ -20,6 +20,7 @@ use LatexIndent::Tokens qw/%tokens/; use LatexIndent::Switches qw/$is_m_switch_active $is_t_switch_active $is_tt_switch_active/; use LatexIndent::HiddenChildren qw/%familyTree/; use LatexIndent::GetYamlSettings qw/%masterSettings/; +use LatexIndent::LogFile qw/$logger/; use Text::Tabs; use Data::Dumper; use Exporter qw/import/; @@ -42,7 +43,7 @@ sub indent{ $self->indent_end_statement; # output the completed object to the log file - $self->logger("Complete indented object (${$self}{name}) after indentation:\n${$self}{begin}${$self}{body}${$self}{end}") if $is_t_switch_active; + $logger->trace("Complete indented object (${$self}{name}) after indentation:\n${$self}{begin}${$self}{body}${$self}{end}") if $is_tt_switch_active; # wrap-up statement $self->wrap_up_statement; @@ -51,7 +52,7 @@ sub indent{ sub wrap_up_statement{ my $self = shift; - $self->logger("Finished indenting ${$self}{name}",'heading') if $is_t_switch_active; + $logger->trace("*Finished indenting ${$self}{name}") if $is_t_switch_active; return $self; } @@ -63,13 +64,13 @@ sub determine_total_indentation{ # logfile information my $surroundingIndentation = ${$self}{surroundingIndentation}; - $self->logger("indenting object ${$self}{name}") if($is_t_switch_active); + $logger->trace("indenting object ${$self}{name}") if($is_t_switch_active); (my $during = $surroundingIndentation) =~ s/\t/TAB/g; - $self->logger("indentation *surrounding* object: '$during'") if($is_t_switch_active); + $logger->trace("indentation *surrounding* object: '$during'") if($is_t_switch_active); ($during = ${$self}{indentation}) =~ s/\t/TAB/g; - $self->logger("indentation *of* object: '$during'") if($is_t_switch_active); + $logger->trace("indentation *of* object: '$during'") if($is_t_switch_active); ($during = $surroundingIndentation.${$self}{indentation}) =~ s/\t/TAB/g; - $self->logger("*total* indentation to be added: '$during'") if($is_t_switch_active); + $logger->trace("*total* indentation to be added: '$during'") if($is_t_switch_active); # form the total indentation of the object ${$self}{indentation} = $surroundingIndentation.${$self}{indentation}; @@ -82,11 +83,11 @@ sub get_surrounding_indentation{ my $surroundingIndentation = q(); if($familyTree{${$self}{id}}){ - $self->logger("Adopted ancestors found!") if($is_t_switch_active); + $logger->trace("Adopted ancestors found!") if($is_t_switch_active); foreach(@{${$familyTree{${$self}{id}}}{ancestors}}){ if(${$_}{type} eq "adopted"){ my $newAncestorId = ${$_}{ancestorID}; - $self->logger("ancestor ID: $newAncestorId, adding indentation of $newAncestorId to surroundingIndentation of ${$self}{id}") if($is_t_switch_active); + $logger->trace("ancestor ID: $newAncestorId, adding indentation of $newAncestorId to surroundingIndentation of ${$self}{id}") if($is_t_switch_active); $surroundingIndentation .= ref(${$_}{ancestorIndentation}) eq 'SCALAR' ? (${${$_}{ancestorIndentation}}?${${$_}{ancestorIndentation}}:q()) @@ -111,7 +112,7 @@ sub indent_body{ my $indentation = ${$self}{indentation}; # output to the logfile - $self->logger("Body (${$self}{name}) before indentation:\n${$self}{body}") if $is_t_switch_active; + $logger->trace("Body (${$self}{name}) before indentation:\n${$self}{body}") if $is_tt_switch_active; # last minute check for modified bodyLineBreaks $self->count_body_line_breaks if $is_m_switch_active; @@ -128,10 +129,10 @@ sub indent_body{ # body indendation if(${$self}{linebreaksAtEnd}{begin}==1){ if(${$self}{body} =~ m/^\h*$/s){ - $self->logger("Body of ${$self}{name} is empty, not applying indentation") if $is_t_switch_active; + $logger->trace("Body of ${$self}{name} is empty, not applying indentation") if $is_t_switch_active; } else { # put any existing horizontal space after the current indentation - $self->logger("Entire body of ${$self}{name} receives indendentation") if $is_t_switch_active; + $logger->trace("Entire body of ${$self}{name} receives indendentation") if $is_t_switch_active; ${$self}{body} =~ s/^(\h*)/$indentation$1/mg; # add indentation } } elsif(${$self}{linebreaksAtEnd}{begin}==0 and ${$self}{bodyLineBreaks}>0) { @@ -142,12 +143,12 @@ sub indent_body{ /sx){ my $bodyFirstLine = $1; my $remainingBody = $2; - $self->logger("first line of body: $bodyFirstLine",'heading') if $is_t_switch_active; - $self->logger("remaining body (before indentation):\n'$remainingBody'") if($is_t_switch_active); + $logger->trace("first line of body: $bodyFirstLine") if $is_tt_switch_active; + $logger->trace("remaining body (before indentation):\n'$remainingBody'") if($is_tt_switch_active); # add the indentation to all the body except first line $remainingBody =~ s/^/$indentation/mg unless($remainingBody eq ''); # add indentation - $self->logger("remaining body (after indentation):\n$remainingBody'") if($is_t_switch_active); + $logger->trace("remaining body (after indentation):\n$remainingBody'") if($is_tt_switch_active); # put the body back together ${$self}{body} = $bodyFirstLine."\n".$remainingBody; @@ -162,12 +163,12 @@ sub indent_body{ # the final linebreak can be modified by a child object; see test-cases/commands/figureValign-mod5.tex, for example if($is_m_switch_active and defined ${$self}{linebreaksAtEnd}{body} and ${$self}{linebreaksAtEnd}{body}==1 and ${$self}{body} !~ m/\R$/ and ${$self}{body} ne ''){ - $self->logger("Adding a linebreak at end of body for ${$self}{name} to contain a linebreak at the end (linebreaksAtEnd is 1, but there isn't currently a linebreak)") if($is_t_switch_active); + $logger->trace("Adding a linebreak at end of body for ${$self}{name} to contain a linebreak at the end (linebreaksAtEnd is 1, but there isn't currently a linebreak)") if($is_t_switch_active); ${$self}{body} .= "\n"; } # output to the logfile - $self->logger("Body (${$self}{name}) after indentation:\n${$self}{body}") if $is_t_switch_active; + $logger->trace("Body (${$self}{name}) after indentation:\n${$self}{body}") if $is_tt_switch_active; return $self; } @@ -195,7 +196,7 @@ sub indent_end_statement{ # end{statement} indentation, e.g \end{environment}, \fi, }, etc if(${$self}{linebreaksAtEnd}{body}){ ${$self}{end} =~ s/^\h*/$surroundingIndentation/mg; # add indentation - $self->logger("Adding surrounding indentation to ${$self}{end} (${$self}{name}: '$surroundingIndentation')") if($is_t_switch_active); + $logger->trace("Adding surrounding indentation to ${$self}{end} (${$self}{name}: '$surroundingIndentation')") if($is_t_switch_active); } return $self; } @@ -222,12 +223,12 @@ sub final_indentation_check{ # count the number of tabs $numberOfTABS = () = $indentation=~ \/\t\/g; - $self->logger("Number of tabs: $numberOfTABS") if($is_t_switch_active); + $logger->trace("Number of tabs: $numberOfTABS") if($is_t_switch_active); # log the after ($after = $indentation) =~ s|\t||g; $after = "TAB"x$numberOfTABS.$after; - $self->logger("Indentation after: '$after'") if($is_t_switch_active); + $logger->trace("Indentation after: '$after'") if($is_t_switch_active); ($indentation = $after) =~s|TAB|\t|g; $indentation; @@ -236,7 +237,7 @@ sub final_indentation_check{ return unless($masterSettings{maximumIndentation} =~ m/^\h+$/); # maximum indentation check - $self->logger("Maximum indentation check",'heading') if($is_t_switch_active); + $logger->trace("*Maximum indentation check") if($is_t_switch_active); # replace any leading tabs with spaces, and update the body my @expanded_lines = expand(${$self}{body}); @@ -255,29 +256,29 @@ sub indent_children_recursively{ my $self = shift; unless(defined ${$self}{children}) { - $self->logger("No child objects (${$self}{name})") if $is_t_switch_active; + $logger->trace("No child objects (${$self}{name})") if $is_t_switch_active; return; } - $self->logger('Pre-processed body:','heading') if $is_t_switch_active; - $self->logger(${$self}{body}) if($is_t_switch_active); + $logger->trace('Pre-processed body:') if $is_tt_switch_active; + $logger->trace(${$self}{body}) if($is_tt_switch_active); # send the children through this indentation routine recursively if(defined ${$self}{children}){ foreach my $child (@{${$self}{children}}){ - $self->logger("Indenting child objects on ${$child}{name}") if $is_t_switch_active; + $logger->trace("Indenting child objects on ${$child}{name}") if $is_t_switch_active; $child->indent_children_recursively; } } - $self->logger("Replacing ids with begin, body, and end statements:",'heading') if $is_t_switch_active; + $logger->trace("*Replacing ids with begin, body, and end statements:") if $is_t_switch_active; # loop through document children hash while( scalar (@{${$self}{children}}) > 0 ){ my $index = 0; # we work through the array *in order* foreach my $child (@{${$self}{children}}){ - $self->logger("Searching ${$self}{name} for ${$child}{id}...",'heading') if $is_t_switch_active; + $logger->trace("Searching ${$self}{name} for ${$child}{id}...") if $is_t_switch_active; if(${$self}{body} =~ m/${$child}{id}/s){ # we only care if id is first non-white space character # and if followed by line break @@ -291,13 +292,14 @@ sub indent_children_recursively{ or ${$self}{body} =~ m/^\h\h*${$child}{id}/m ) ?1:0; - $IDFollowedImmediatelyByLineBreak = (${$self}{body} =~ m/${$child}{id}\h*\R*/m) ?1:0; + $IDFollowedImmediatelyByLineBreak = (${$self}{body} =~ m/${$child}{id}\h*\R+/m) ?1:0; + ${$child}{IDFollowedImmediatelyByLineBreak} = $IDFollowedImmediatelyByLineBreak; } # log file info - $self->logger("${$child}{id} found!") if($is_t_switch_active); - $self->logger("Indenting ${$child}{name} (id: ${$child}{id})",'heading') if $is_t_switch_active; - $self->logger("looking up indentation scheme for ${$child}{name}") if($is_t_switch_active); + $logger->trace("${$child}{id} found!") if($is_t_switch_active); + $logger->trace("*Indenting ${$child}{name} (id: ${$child}{id})") if $is_t_switch_active; + $logger->trace("looking up indentation scheme for ${$child}{name}") if($is_t_switch_active); # line break checks *after* if (defined ${$child}{EndFinishesWithLineBreak} @@ -305,7 +307,7 @@ sub indent_children_recursively{ and $IDFollowedImmediatelyByLineBreak) { # remove line break *after* , if appropriate my $EndStringLogFile = ${$child}{aliases}{EndFinishesWithLineBreak}||"EndFinishesWithLineBreak"; - $self->logger("Removing linebreak after ${$child}{end} (see $EndStringLogFile)") if $is_t_switch_active; + $logger->trace("Removing linebreak after ${$child}{end} (see $EndStringLogFile)") if $is_t_switch_active; ${$self}{body} =~ s/${$child}{id}(\h*)?(\R|\h)*/${$child}{id}$1/s; ${$child}{linebreaksAtEnd}{end} = 0; } @@ -329,15 +331,15 @@ sub indent_children_recursively{ # by default, assume that no trailing comment token is needed my $trailingCharacterToken = q(); if(${$child}{BeginStartsOnOwnLine}==2){ - $self->logger("Removing space immediately before ${$child}{id}, in preparation for adding % ($BeginStringLogFile == 2)") if $is_t_switch_active; + $logger->trace("Removing space immediately before ${$child}{id}, in preparation for adding % ($BeginStringLogFile == 2)") if $is_t_switch_active; ${$self}{body} =~ s/\h*${$child}{id}/${$child}{id}/s; - $self->logger("Adding a % at the end of the line that ${$child}{begin} is on, then a linebreak ($BeginStringLogFile == 2)") if $is_t_switch_active; + $logger->trace("Adding a % at the end of the line that ${$child}{begin} is on, then a linebreak ($BeginStringLogFile == 2)") if $is_t_switch_active; $trailingCharacterToken = "%".$self->add_comment_symbol; } elsif (${$child}{BeginStartsOnOwnLine}==3){ - $self->logger("Adding a blank line at the end of the line that ${$child}{begin} is on, then a linebreak ($BeginStringLogFile == 3)") if $is_t_switch_active; + $logger->trace("Adding a blank line at the end of the line that ${$child}{begin} is on, then a linebreak ($BeginStringLogFile == 3)") if $is_t_switch_active; $trailingCharacterToken = "\n".(${$masterSettings{modifyLineBreaks}}{preserveBlankLines}?$tokens{blanklines}:q()); } else { - $self->logger("Adding a linebreak at the beginning of ${$child}{begin} (see $BeginStringLogFile)") if $is_t_switch_active; + $logger->trace("Adding a linebreak at the beginning of ${$child}{begin} (see $BeginStringLogFile)") if $is_t_switch_active; } # the trailing comment/linebreak magic @@ -351,33 +353,33 @@ sub indent_children_recursively{ # important to check we don't move the begin statement next to a blank-line-token my $blankLineToken = $tokens{blanklines}; if(${$self}{body} !~ m/$blankLineToken\R*\h*${$child}{id}/s){ - $self->logger("Removing linebreak before ${$child}{begin} (see $BeginStringLogFile in ${$child}{modifyLineBreaksYamlName} YAML)") if $is_t_switch_active; + $logger->trace("Removing linebreak before ${$child}{begin} (see $BeginStringLogFile in ${$child}{modifyLineBreaksYamlName} YAML)") if $is_t_switch_active; ${$self}{body} =~ s/(\h*)(?:\R*|\h*)+${$child}{id}/$1${$child}{id}/s; } else { - $self->logger("Not removing linebreak ahead of ${$child}{begin}, as blank-line-token present (see preserveBlankLines)") if $is_t_switch_active; + $logger->trace("Not removing linebreak ahead of ${$child}{begin}, as blank-line-token present (see preserveBlankLines)") if $is_t_switch_active; } } } - $self->logger(Dumper(\%{$child}),'ttrace') if($is_tt_switch_active); + $logger->trace(Dumper(\%{$child})) if($is_tt_switch_active); # replace ids with body ${$self}{body} =~ s/${$child}{id}/${$child}{begin}${$child}{body}${$child}{end}/; # log file info - $self->logger("Body (${$self}{name}) now looks like:",'heading') if $is_t_switch_active; - $self->logger(${$self}{body}) if($is_t_switch_active); + $logger->trace("Body (${$self}{name}) now looks like:") if $is_tt_switch_active; + $logger->trace(${$self}{body}) if($is_tt_switch_active); # remove element from array: http://stackoverflow.com/questions/174292/what-is-the-best-way-to-delete-a-value-from-an-array-in-perl splice(@{${$self}{children}}, $index, 1); # output to the log file - $self->logger("deleted child key ${$child}{name} (parent is: ${$self}{name})") if $is_t_switch_active; + $logger->trace("deleted child key ${$child}{name} (parent is: ${$self}{name})") if $is_t_switch_active; # restart the loop, as the size of the array has changed last; } else { - $self->logger("${$child}{id} not found") if($is_t_switch_active); + $logger->trace("${$child}{id} not found") if($is_t_switch_active); } # increment the loop counter @@ -386,10 +388,10 @@ sub indent_children_recursively{ } # logfile info - $self->logger("${$self}{name} has this many children:",'heading') if $is_t_switch_active; - $self->logger(scalar @{${$self}{children}}) if $is_t_switch_active; - $self->logger("Post-processed body (${$self}{name}):") if($is_t_switch_active); - $self->logger(${$self}{body}) if($is_t_switch_active); + $logger->trace("${$self}{name} has this many children:") if $is_tt_switch_active; + $logger->trace(scalar @{${$self}{children}}) if $is_tt_switch_active; + $logger->trace("Post-processed body (${$self}{name}):") if($is_tt_switch_active); + $logger->trace(${$self}{body}) if($is_tt_switch_active); } diff --git a/LatexIndent/Item.pm b/LatexIndent/Item.pm index 4861cb9f..8a72257e 100644 --- a/LatexIndent/Item.pm +++ b/LatexIndent/Item.pm @@ -20,6 +20,7 @@ use LatexIndent::Tokens qw/%tokens/; use LatexIndent::TrailingComments qw/$trailingCommentRegExp/; use LatexIndent::GetYamlSettings qw/%masterSettings/; use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/; +use LatexIndent::LogFile qw/$logger/; use Data::Dumper; use Exporter qw/import/; our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321 @@ -37,7 +38,7 @@ sub construct_list_of_items{ } # detail items in the log - $self->logger("List of items: $listOfItems (see itemNames)",'heading') if $is_t_switch_active; + $logger->trace("*List of items: $listOfItems (see itemNames)") if $is_t_switch_active; $itemRegExp = qr/ ( @@ -68,13 +69,13 @@ sub find_items{ return unless ${$masterSettings{indentAfterItems}}{${$self}{name}}; # otherwise loop through the item names - $self->logger("Searching for items (see itemNames) in ${$self}{name} (see indentAfterItems)") if $is_t_switch_active; - $self->logger(Dumper(\%{$masterSettings{itemNames}})) if $is_t_switch_active; + $logger->trace("Searching for items (see itemNames) in ${$self}{name} (see indentAfterItems)") if $is_t_switch_active; + $logger->trace(Dumper(\%{$masterSettings{itemNames}})) if $is_tt_switch_active; while(${$self}{body} =~ m/$itemRegExp\h*($trailingCommentRegExp)?/){ # log file output - $self->logger("Item found: $2",'heading') if $is_t_switch_active; + $logger->trace("*Item found: $2") if $is_t_switch_active; ${$self}{body} =~ s/ $itemRegExp(\h*)($trailingCommentRegExp)? @@ -137,7 +138,7 @@ sub remove_line_breaks_begin{ # there is no white space my $self = shift; my $BodyStringLogFile = ${$self}{aliases}{BodyStartsOnOwnLine}||"BodyStartsOnOwnLine"; - $self->logger("Removing linebreak at the end of begin (see $BodyStringLogFile)"); + $logger->trace("Removing linebreak at the end of begin (see $BodyStringLogFile)"); ${$self}{begin} =~ s/\R*$//sx; ${$self}{begin} .= " " unless(${$self}{begin} =~ m/\h$/s or ${$self}{body} =~ m/^\h/s or ${$self}{body} =~ m/^\R/s ); ${$self}{linebreaksAtEnd}{begin} = 0; diff --git a/LatexIndent/KeyEqualsValuesBraces.pm b/LatexIndent/KeyEqualsValuesBraces.pm index 974003d3..0e939731 100644 --- a/LatexIndent/KeyEqualsValuesBraces.pm +++ b/LatexIndent/KeyEqualsValuesBraces.pm @@ -18,8 +18,8 @@ use strict; use warnings; use LatexIndent::Tokens qw/%tokens/; use LatexIndent::TrailingComments qw/$trailingCommentRegExp/; -use LatexIndent::Switches qw/$is_m_switch_active/; -use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/; +use LatexIndent::Switches qw/$is_m_switch_active $is_t_switch_active $is_tt_switch_active/; +use LatexIndent::LogFile qw/$logger/; use Data::Dumper; use Exporter qw/import/; our @ISA = "LatexIndent::Command"; # class inheritance, Programming Perl, pg 321 @@ -73,7 +73,7 @@ sub indent_begin{ my $blankLineToken = $tokens{blanklines}; if(${$self}{begin} =~ /\R=/s or ${$self}{begin} =~ /$blankLineToken\h*=/s ){ - $self->logger("= found on own line in ${$self}{name}, adding indentation") if $is_t_switch_active; + $logger->trace("= found on own line in ${$self}{name}, adding indentation") if $is_t_switch_active; ${$self}{begin} =~ s/=/${$self}{indentation}=/s; } } @@ -87,15 +87,15 @@ sub check_linebreaks_before_equals{ # linebreaks *infront* of = symbol if(${$self}{begin} =~ /\R\h*=/s){ if(defined ${$self}{EqualsStartsOnOwnLine} and ${$self}{EqualsStartsOnOwnLine}==-1){ - $self->logger("Removing linebreak before = symbol in ${$self}{name} (see EqualsStartsOnOwnLine)") if $is_t_switch_active; + $logger->trace("Removing linebreak before = symbol in ${$self}{name} (see EqualsStartsOnOwnLine)") if $is_t_switch_active; ${$self}{begin} =~ s/(\R|\h)*=/=/s; } } else { if(defined ${$self}{EqualsStartsOnOwnLine} and ${$self}{EqualsStartsOnOwnLine}==1){ - $self->logger("Adding a linebreak before = symbol for ${$self}{name} (see EqualsStartsOnOwnLine)") if $is_t_switch_active; + $logger->trace("Adding a linebreak before = symbol for ${$self}{name} (see EqualsStartsOnOwnLine)") if $is_t_switch_active; ${$self}{begin} =~ s/=/\n=/s; } elsif(defined ${$self}{EqualsStartsOnOwnLine} and ${$self}{EqualsStartsOnOwnLine}==2){ - $self->logger("Adding a % linebreak immediately before = symbol for ${$self}{name} (see EqualsStartsOnOwnLine)") if $is_t_switch_active; + $logger->trace("Adding a % linebreak immediately before = symbol for ${$self}{name} (see EqualsStartsOnOwnLine)") if $is_t_switch_active; ${$self}{begin} =~ s/\h*=/%\n=/s; } } @@ -114,7 +114,7 @@ sub get_replacement_text{ my $self = shift; # the replacement text for a key = {value} needes to accomodate the leading [ OR { OR % OR , OR any combination thereof - $self->logger("Custom replacement text routine for ${$self}{name}") if $is_t_switch_active; + $logger->trace("Custom replacement text routine for ${$self}{name}") if $is_t_switch_active; ${$self}{replacementText} = ${$self}{beginningbit}.${$self}{id}; delete ${$self}{beginningbit}; } diff --git a/LatexIndent/LogFile.pm b/LatexIndent/LogFile.pm index 128034a2..ff118352 100644 --- a/LatexIndent/LogFile.pm +++ b/LatexIndent/LogFile.pm @@ -16,39 +16,25 @@ package LatexIndent::LogFile; # For all communication, please visit: https://github.com/cmhughes/latexindent.pl use strict; use warnings; -use LatexIndent::GetYamlSettings qw/%masterSettings/; -use LatexIndent::Switches qw/%switches/; -use LatexIndent::Version qw/$versionNumber $versionDate/; use FindBin; use File::Basename; # to get the filename and directory path use Exporter qw/import/; -our @EXPORT_OK = qw/logger output_logfile processSwitches/; +use Log::Log4perl qw(get_logger :levels); +use Log::Log4perl::Appender::Screen; +use Log::Dispatch::File; +use LatexIndent::GetYamlSettings qw/%masterSettings/; +use LatexIndent::Switches qw/%switches/; +use LatexIndent::Version qw/$versionNumber $versionDate/; +our @EXPORT_OK = qw/processSwitches $logger/; our @logFileNotes; +our $logger = get_logger("Document"); -# log file methods -# log file methods -# log file methods -# reference: http://stackoverflow.com/questions/6736998/help-calling-a-sub-routine-from-a-perl-module-and-printing-to-logfile - -sub logger{ - shift; - my $line = shift; - my $infoLevel = shift; - push(@logFileNotes,{line=>$line,level=>$infoLevel?$infoLevel:'default'}); - return -} +# log file methods, using log4perl; references +# pattern layout: http://search.cpan.org/~mschilli/Log-Log4perl-1.32/lib/Log/Log4perl/Layout/PatternLayout.pm +# multiple appenders: https://stackoverflow.com/questions/8620347/perl-log4perl-printing-and-logging-at-the-same-time-in-a-line?rq=1 +# getting started: https://www.perl.com/pub/2002/09/11/log4perl.html sub processSwitches{ - my $self = shift; - - # details of the script to log file - $self->logger("$FindBin::Script version $versionNumber, $versionDate, a script to indent .tex files",'heading'); - $self->logger("$FindBin::Script lives here: $FindBin::RealBin/"); - - # time the script is used - my $time = localtime(); - $self->logger("$time"); - # -v switch is just to show the version number if($switches{version}) { print $versionNumber,", ",$versionDate,"\n"; @@ -63,6 +49,8 @@ usage: latexindent.pl [options] [file][.tex|.sty|.cls|.bib|...] displays the version number and date of release -h, --help help (see the documentation for detailed instructions and examples) + -sl, --screenlog + log file will also be output to the screen -o, --outputfile= output to another file; sample usage: latexindent.pl -o outputfile.tex myfile.tex @@ -97,84 +85,154 @@ ENDQUOTE exit(2); } + # if we've made it this far, the processing of switches and logging begins + my $self = shift; + + ($switches{trace}||$switches{ttrace}) ? $logger->level($TRACE): $logger->level($INFO); + + # cruft directory + ${$self}{cruftDirectory} = $switches{cruftDirectory}||(dirname ${$self}{fileName}); + die "Could not find directory ${$self}{cruftDirectory}\nExiting, no indentation done." if(!(-d ${$self}{cruftDirectory})); + + my $logfileName = ($switches{cruftDirectory} ? ${$self}{cruftDirectory} : '').($switches{logFileName}||"indent.log"); + + # layout of the logfile information, for example + # + # 2017/09/16 11:59:09 INFO: message + # 2017/09/16 12:23:53 INFO: LogFile.pm:156 LatexIndent::LogFile::processSwitches - message + # reference: https://stackoverflow.com/questions/46262844/log4perl-grouping-messages/46309392#46309392 + Log::Log4perl::Layout::PatternLayout::add_global_cspec( + 'A', sub { + if($_[1] =~ /^\*/){ + $_[1]=~s/^\*//; + if($_[1]=~m/\R/s){ + my $indentation = ' '.(' ' x length $_[3]); + $_[1] =~ s/\R/\n$indentation/gs; + } + return "$_[3]: ".$_[1]; + } else { + my $indentation = ' '.(' ' x length $_[3]); + $_[1] =~ s/\R/\n$indentation/gs if($_[1]=~m/\R/s); + return $indentation.$_[1]; + } + }); + + my $layout = Log::Log4perl::Layout::PatternLayout->new("%A%n"); + + # details for the Log4perl logging + my $appender = Log::Log4perl::Appender->new( + "Log::Dispatch::File", + filename => $logfileName, + mode => "write", + utf8 => 1, + ); + + # add the layout + $appender->layout($layout); + + # adjust the logger object + $logger->add_appender($appender); + + # appender object for output to screen + my $appender_screen = q(); + + # output to screen, if appropriate + if($switches{screenlog}){ + $appender_screen = Log::Log4perl::Appender->new( + "Log::Log4perl::Appender::Screen", + stderr => 0, + utf8 => 1, + ); + + $appender_screen->layout($layout); + $logger->add_appender($appender_screen); + } + + # details of the script to log file + $logger->info("*$FindBin::Script version $versionNumber, $versionDate, a script to indent .tex files"); + $logger->info("$FindBin::Script lives here: $FindBin::RealBin/"); + + my $time = localtime(); + $logger->info($time); + + if (${$self}{fileName} ne "-"){ + $logger->info("Filename: ${$self}{fileName}"); + } else { + $logger->info("Reading input from STDIN"); + } + # log the switches from the user - $self->logger('Processing switches','heading'); + $logger->info("*Processing switches:"); # check on the trace mode switch (should be turned on if ttrace mode active) $switches{trace} = $switches{ttrace} ? 1 : $switches{trace}; - + # output details of switches - $self->logger('-t|--trace: Trace mode active (you have used either -t or --trace)') if($switches{trace} and !$switches{ttrace}); - $self->logger('-tt|--ttrace: TTrace mode active (you have used either -tt or --ttrace)') if($switches{tracingModeVeryDetailed}); - $self->logger('-s|--silent: Silent mode active (you have used either -s or --silent)') if($switches{silentMode}); - $self->logger('-d|--onlydefault: Only defaultSettings.yaml will be used (you have used either -d or --onlydefault)') if($switches{onlyDefault}); - $self->logger("-w|--overwrite: Overwrite mode active, will make a back up of ${$self}{fileName} first") if($switches{overwrite}); - $self->logger("-l|--localSettings: Read localSettings YAML file") if($switches{readLocalSettings}); - $self->logger("-y|--yaml: YAML settings specified via command line") if($switches{yaml}); - $self->logger("-o|--outputfile: output to file") if($switches{outputToFile}); - $self->logger("-m|--modifylinebreaks: modify line breaks") if($switches{modifyLineBreaks}); - $self->logger("-g|--logfile: logfile name") if($switches{logFileName}); - $self->logger("-c|--cruft: cruft directory") if($switches{cruftDirectory}); + $logger->info("-sl|--screenlog: log file will also be output to the screen") if($switches{screenlog}); + $logger->info("-t|--trace: Trace mode active (you have used either -t or --trace)") if($switches{trace} and !$switches{ttrace}); + $logger->info("-tt|--ttrace: TTrace mode active (you have used either -tt or --ttrace)") if($switches{ttrace}); + $logger->info("-s|--silent: Silent mode active (you have used either -s or --silent)") if($switches{silentMode}); + $logger->info("-d|--onlydefault: Only defaultSettings.yaml will be used (you have used either -d or --onlydefault)") if($switches{onlyDefault}); + $logger->info("-w|--overwrite: Overwrite mode active, will make a back up of ${$self}{fileName} first") if($switches{overwrite}); + $logger->info("-l|--localSettings: Read localSettings YAML file") if($switches{readLocalSettings}); + $logger->info("-y|--yaml: YAML settings specified via command line") if($switches{yaml}); + $logger->info("-o|--outputfile: output to file") if($switches{outputToFile}); + $logger->info("-m|--modifylinebreaks: modify line breaks") if($switches{modifyLineBreaks}); + $logger->info("-g|--logfile: logfile name") if($switches{logFileName}); + $logger->info("-c|--cruft: cruft directory") if($switches{cruftDirectory}); # check if overwrite and outputfile are active similtaneously if($switches{overwrite} and $switches{outputToFile}){ - $self->logger("Options check",'heading'); - $self->logger("You have called latexindent.pl with both -o and -w"); - $self->logger("-o (output to file) will take priority, and -w (over write) will be ignored"); + $logger->info("Options check, -w and -o specified\nYou have called latexindent.pl with both -o and -w\noutput to file) will take priority, and -w (over write) will be ignored"); $switches{overwrite}=0; } - # cruft directory - ${$self}{cruftDirectory} = $switches{cruftDirectory}||(dirname ${$self}{fileName}); - die "Could not find directory ${$self}{cruftDirectory}\nExiting, no indentation done." if(!(-d ${$self}{cruftDirectory})); - my $logfileName = $switches{logFileName}||"indent.log"; - $self->logger("Directory for backup files and $logfileName: ${$self}{cruftDirectory}",'heading'); + $logger->info("*Directory for backup files and $logfileName: ${$self}{cruftDirectory}"); # output location of modules if($FindBin::Script eq 'latexindent.pl' or ($FindBin::Script eq 'latexindent.exe' and $switches{trace} )) { - my @listOfModules = ('FindBin', 'YAML::Tiny', 'File::Copy', 'File::Basename', 'Getopt::Long','File::HomeDir','Unicode::GCString'); - $self->logger("Perl modules are being loaded from the following directories:",'heading'); + my @listOfModules = ('FindBin', 'YAML::Tiny', 'File::Copy', 'File::Basename', 'Getopt::Long','File::HomeDir','Unicode::GCString','Log::Log4perl'); + $logger->info("*Perl modules are being loaded from the following directories:"); foreach my $moduleName (@listOfModules) { (my $file = $moduleName) =~ s|::|/|g; - require $file . '.pm'; - $self->logger($INC{$file .'.pm'}); + $logger->info($INC{$file .'.pm'}); } - $self->logger("Latex Indent perl modules are being loaded from, for example:",'heading'); + $logger->info("*Latex Indent perl modules are being loaded from, for example:"); (my $file = 'LatexIndent::Document') =~ s|::|/|g; - require $file . '.pm'; - $self->logger($INC{$file .'.pm'}); + $logger->info($INC{$file .'.pm'}); } - return; -} -sub output_logfile{ - my $self = shift; - my $logfile; - my $logfileName = $switches{logFileName}||"indent.log"; - - open($logfile,">","${$self}{cruftDirectory}/$logfileName") or die "Can't open $logfileName"; - - # put the final line in the logfile - $self->logger("${$masterSettings{logFilePreferences}}{endLogFileWith}",'heading'); - - # github info line - $self->logger("Please direct all communication/issues to: ",'heading') if ${$masterSettings{logFilePreferences}}{showGitHubInfoFooter}; - $self->logger("https://github.com/cmhughes/latexindent.pl") if ${$masterSettings{logFilePreferences}}{showGitHubInfoFooter}; - - # output the logfile - foreach my $line (@logFileNotes){ - if(${$line}{level} eq 'heading'){ - print $logfile ${$line}{line},"\n"; - } elsif(${$line}{level} eq 'default') { - # add tabs to the beginning of lines - # for default logfile lines - ${$line}{line} =~ s/^/\t/mg; - print $logfile ${$line}{line},"\n"; - } - } - - close($logfile); -} + # read the YAML settings + $self->readSettings; + + # the user may have specified their own settings for the rest of the log file, + # for example: + # + # logFilePreferences: + # PatternLayout: + # default: "%p: %m{indent}%n" + # trace: "%p: %m{indent}%n" + # ttrace: "%d %p: %F{1}:%L %M - %m{indent}%n" + # + # e.g, default mode: + # 2017/09/16 11:59:09 INFO: message + # or trace mode: + # 2017/09/16 11:59:09 INFO: message + # or in trace mode: + # 2017/09/16 12:23:53 INFO: LogFile.pm:156 LatexIndent::LogFile::processSwitches - message + my $pattern = q(); + if($switches{ttrace}){ + $pattern = ${${$masterSettings{logFilePreferences}}{PatternLayout}}{ttrace}; + } elsif($switches{trace}){ + $pattern = ${${$masterSettings{logFilePreferences}}{PatternLayout}}{trace}; + } else { + $pattern = ${${$masterSettings{logFilePreferences}}{PatternLayout}}{default}; + } + $layout = Log::Log4perl::Layout::PatternLayout->new($pattern); + $appender->layout($layout); + $appender_screen->layout($layout) if $switches{screenlog}; + return; +} 1; diff --git a/LatexIndent/MandatoryArgument.pm b/LatexIndent/MandatoryArgument.pm index 47b538d2..51fc9e64 100644 --- a/LatexIndent/MandatoryArgument.pm +++ b/LatexIndent/MandatoryArgument.pm @@ -19,6 +19,7 @@ use warnings; use LatexIndent::Tokens qw/%tokens/; use LatexIndent::TrailingComments qw/$trailingCommentRegExp/; use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/; +use LatexIndent::LogFile qw/$logger/; use Exporter qw/import/; our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321 our @EXPORT_OK = qw/find_mandatory_arguments get_mand_arg_reg_exp/; @@ -32,8 +33,8 @@ sub find_mandatory_arguments{ # pick out the mandatory arguments while(${$self}{body} =~ m/$mandArgRegExp\h*($trailingCommentRegExp)*(.*)/s){ # log file output - $self->logger("Mandatory argument found, body in ${$self}{name}",'heading') if $is_t_switch_active; - $self->logger("(last argument)") if($9 eq '' and $is_t_switch_active); + $logger->trace("*Mandatory argument found, body in ${$self}{name}") if $is_t_switch_active; + $logger->trace("(last argument)") if($9 eq '' and $is_t_switch_active); ${$self}{body} =~ s/ $mandArgRegExp(\h*)($trailingCommentRegExp)*(.*) diff --git a/LatexIndent/ModifyLineBreaks.pm b/LatexIndent/ModifyLineBreaks.pm index d527f5d7..7b704736 100644 --- a/LatexIndent/ModifyLineBreaks.pm +++ b/LatexIndent/ModifyLineBreaks.pm @@ -24,7 +24,8 @@ use LatexIndent::Tokens qw/%tokens/; use LatexIndent::TrailingComments qw/$trailingCommentRegExp/; use LatexIndent::Switches qw/$is_m_switch_active $is_t_switch_active $is_tt_switch_active/; use LatexIndent::Item qw/$listOfItems/; -our @EXPORT_OK = qw/modify_line_breaks_body modify_line_breaks_end adjust_line_breaks_end_parent remove_line_breaks_begin max_char_per_line paragraphs_on_one_line construct_paragraph_reg_exp/; +use LatexIndent::LogFile qw/$logger/; +our @EXPORT_OK = qw/modify_line_breaks_body modify_line_breaks_end adjust_line_breaks_end_parent remove_line_breaks_begin max_char_per_line paragraphs_on_one_line construct_paragraph_reg_exp one_sentence_per_line/; our $paragraphRegExp = q(); @@ -42,33 +43,33 @@ sub modify_line_breaks_body{ # BodyStartsOnOwnLine == 3 add a blank line, and then new line if(${$self}{BodyStartsOnOwnLine}==1){ # modify the begin statement - $self->logger("Adding a linebreak at the end of begin, ${$self}{begin} (see $BodyStringLogFile)") if $is_t_switch_active; + $logger->trace("Adding a linebreak at the end of begin, ${$self}{begin} (see $BodyStringLogFile)") if $is_t_switch_active; ${$self}{begin} .= "\n"; ${$self}{linebreaksAtEnd}{begin} = 1; - $self->logger("Removing leading space from body of ${$self}{name} (see $BodyStringLogFile)") if $is_t_switch_active; + $logger->trace("Removing leading space from body of ${$self}{name} (see $BodyStringLogFile)") if $is_t_switch_active; ${$self}{body} =~ s/^\h*//; } elsif(${$self}{BodyStartsOnOwnLine}==2){ # by default, assume that no trailing comment token is needed my $trailingCommentToken = q(); if(${$self}{body} !~ m/^\h*$trailingCommentRegExp/s){ # modify the begin statement - $self->logger("Adding a % at the end of begin ${$self}{begin} followed by a linebreak ($BodyStringLogFile == 2)") if $is_t_switch_active; + $logger->trace("Adding a % at the end of begin ${$self}{begin} followed by a linebreak ($BodyStringLogFile == 2)") if $is_t_switch_active; $trailingCommentToken = "%".$self->add_comment_symbol; ${$self}{begin} =~ s/\h*$//; ${$self}{begin} .= "$trailingCommentToken\n"; ${$self}{linebreaksAtEnd}{begin} = 1; - $self->logger("Removing leading space from body of ${$self}{name} (see $BodyStringLogFile)") if $is_t_switch_active; + $logger->trace("Removing leading space from body of ${$self}{name} (see $BodyStringLogFile)") if $is_t_switch_active; ${$self}{body} =~ s/^\h*//; } else { - $self->logger("Even though $BodyStringLogFile == 2, ${$self}{begin} already finishes with a %, so not adding another.") if $is_t_switch_active; + $logger->trace("Even though $BodyStringLogFile == 2, ${$self}{begin} already finishes with a %, so not adding another.") if $is_t_switch_active; } } elsif (${$self}{BodyStartsOnOwnLine}==3){ my $trailingCharacterToken = q(); - $self->logger("Adding a blank line at the end of begin ${$self}{begin} followed by a linebreak ($BodyStringLogFile == 3)") if $is_t_switch_active; + $logger->trace("Adding a blank line at the end of begin ${$self}{begin} followed by a linebreak ($BodyStringLogFile == 3)") if $is_t_switch_active; ${$self}{begin} =~ s/\h*$//; ${$self}{begin} .= (${$masterSettings{modifyLineBreaks}}{preserveBlankLines}?$tokens{blanklines}:"\n")."\n"; ${$self}{linebreaksAtEnd}{begin} = 1; - $self->logger("Removing leading space from body of ${$self}{name} (see $BodyStringLogFile)") if $is_t_switch_active; + $logger->trace("Removing leading space from body of ${$self}{name} (see $BodyStringLogFile)") if $is_t_switch_active; ${$self}{body} =~ s/^\h*//; } } elsif (${$self}{BodyStartsOnOwnLine}==-1 and ${$self}{linebreaksAtEnd}{begin}){ @@ -81,7 +82,7 @@ sub modify_line_breaks_body{ sub remove_line_breaks_begin{ my $self = shift; my $BodyStringLogFile = ${$self}{aliases}{BodyStartsOnOwnLine}||"BodyStartsOnOwnLine"; - $self->logger("Removing linebreak at the end of begin (see $BodyStringLogFile)") if $is_t_switch_active; + $logger->trace("Removing linebreak at the end of begin (see $BodyStringLogFile)") if $is_t_switch_active; ${$self}{begin} =~ s/\R*$//sx; ${$self}{linebreaksAtEnd}{begin} = 0; } @@ -98,16 +99,16 @@ sub modify_line_breaks_end{ # EndStartsOnOwnLine == 1 just add a new line # EndStartsOnOwnLine == 2 add a comment, and then new line # EndStartsOnOwnLine == 3 add a blank line, and then new line - $self->logger("Adding a linebreak at the end of body (see $EndStringLogFile)") if $is_t_switch_active; + $logger->trace("Adding a linebreak at the end of body (see $EndStringLogFile)") if $is_t_switch_active; # by default, assume that no trailing character token is needed my $trailingCharacterToken = q(); if(${$self}{EndStartsOnOwnLine}==2){ - $self->logger("Adding a % immediately after body of ${$self}{name} ($EndStringLogFile==2)") if $is_t_switch_active; + $logger->trace("Adding a % immediately after body of ${$self}{name} ($EndStringLogFile==2)") if $is_t_switch_active; $trailingCharacterToken = "%".$self->add_comment_symbol; ${$self}{body} =~ s/\h*$//s; } elsif (${$self}{EndStartsOnOwnLine}==3) { - $self->logger("Adding a blank line immediately after body of ${$self}{name} ($EndStringLogFile==3)") if $is_t_switch_active; + $logger->trace("Adding a blank line immediately after body of ${$self}{name} ($EndStringLogFile==3)") if $is_t_switch_active; $trailingCharacterToken = "\n".(${$masterSettings{modifyLineBreaks}}{preserveBlankLines}?$tokens{blanklines}:q()); ${$self}{body} =~ s/\h*$//s; } @@ -125,11 +126,11 @@ sub modify_line_breaks_end{ # check to see that body does *not* finish with blank-line-token, # if so, then don't remove that final line break if(${$self}{body} !~ m/$tokens{blanklines}$/s){ - $self->logger("Removing linebreak at the end of body (see $EndStringLogFile)") if $is_t_switch_active; + $logger->trace("Removing linebreak at the end of body (see $EndStringLogFile)") if $is_t_switch_active; ${$self}{body} =~ s/\R*$//sx; ${$self}{linebreaksAtEnd}{body} = 0; } else { - $self->logger("Blank line token found at end of body (${$self}{name}), see preserveBlankLines, not removing line break before ${$self}{end}") if $is_t_switch_active; + $logger->trace("Blank line token found at end of body (${$self}{name}), see preserveBlankLines, not removing line break before ${$self}{end}") if $is_t_switch_active; } } } @@ -145,7 +146,7 @@ sub modify_line_breaks_end{ # EndFinishesWithLineBreak == 3 add a blank line, and then new line my $EndStringLogFile = ${$self}{aliases}{EndFinishesWithLineBreak}||"EndFinishesWithLineBreak"; if(${$self}{EndFinishesWithLineBreak}==1){ - $self->logger("Adding a linebreak at the end of ${$self}{end} ($EndStringLogFile==1)") if $is_t_switch_active; + $logger->trace("Adding a linebreak at the end of ${$self}{end} ($EndStringLogFile==1)") if $is_t_switch_active; ${$self}{linebreaksAtEnd}{end} = 1; # modified end statement @@ -153,17 +154,17 @@ sub modify_line_breaks_end{ } elsif(${$self}{EndFinishesWithLineBreak}==2){ if(${$self}{endImmediatelyFollowedByComment}){ # no need to add a % if one already exists - $self->logger("Even though $EndStringLogFile == 2, ${$self}{end} is immediately followed by a %, so not adding another; not adding line break.") if $is_t_switch_active; + $logger->trace("Even though $EndStringLogFile == 2, ${$self}{end} is immediately followed by a %, so not adding another; not adding line break.") if $is_t_switch_active; } else { # otherwise, create a trailing comment, and tack it on - $self->logger("Adding a % immediately after, ${$self}{end} ($EndStringLogFile==2)") if $is_t_switch_active; + $logger->trace("Adding a % immediately after, ${$self}{end} ($EndStringLogFile==2)") if $is_t_switch_active; my $trailingCommentToken = "%".$self->add_comment_symbol; ${$self}{end} =~ s/\h*$//s; ${$self}{replacementText} .= "$trailingCommentToken\n"; ${$self}{linebreaksAtEnd}{end} = 1; } } elsif(${$self}{EndFinishesWithLineBreak}==3){ - $self->logger("Adding a blank line at the end of ${$self}{end} ($EndStringLogFile==3)") if $is_t_switch_active; + $logger->trace("Adding a blank line at the end of ${$self}{end} ($EndStringLogFile==3)") if $is_t_switch_active; ${$self}{linebreaksAtEnd}{end} = 1; # modified end statement @@ -185,9 +186,9 @@ sub adjust_line_breaks_end_parent{ # adjust parent linebreaks information if(${$child}{linebreaksAtEnd}{end} and ${$self}{body} =~ m/${$child}{replacementText}\h*\R*$/s and !${$self}{linebreaksAtEnd}{body}){ - $self->logger("ID: ${$child}{id}") if($is_t_switch_active); - $self->logger("${$child}{begin}...${$child}{end} is found at the END of body of parent, ${$self}{name}, avoiding a double line break:") if($is_t_switch_active); - $self->logger("adjusting ${$self}{name} linebreaksAtEnd{body} to be 1") if($is_t_switch_active); + $logger->trace("ID: ${$child}{id}") if($is_t_switch_active); + $logger->trace("${$child}{begin}...${$child}{end} is found at the END of body of parent, ${$self}{name}, avoiding a double line break:") if($is_t_switch_active); + $logger->trace("adjusting ${$self}{name} linebreaksAtEnd{body} to be 1") if($is_t_switch_active); ${$self}{linebreaksAtEnd}{body}=1; } @@ -197,8 +198,8 @@ sub adjust_line_breaks_end_parent{ and !${$child}{linebreaksAtEnd}{body} and ${$child}{body} =~ m/\R(?:$trailingCommentRegExp\h*)?$/s ){ # log file information - $self->logger("Undisclosed line break at the end of body of ${$child}{name}: '${$child}{end}'") if($is_t_switch_active); - $self->logger("Adding a linebreak at the end of body for ${$child}{id}") if($is_t_switch_active); + $logger->trace("Undisclosed line break at the end of body of ${$child}{name}: '${$child}{end}'") if($is_t_switch_active); + $logger->trace("Adding a linebreak at the end of body for ${$child}{id}") if($is_t_switch_active); # make the adjustments ${$child}{body} .= "\n"; @@ -224,6 +225,7 @@ sub max_char_per_line{ sub construct_paragraph_reg_exp{ my $self = shift; + $logger->trace("*Constructing the paragraph-stop regexp (see paragraphsStopAt)") if $is_t_switch_active ; my $stopAtRegExp = q(); while( my ($paragraphStopAt,$yesNo)= each %{${$masterSettings{modifyLineBreaks}{removeParagraphLineBreaks}}{paragraphsStopAt}}){ if($yesNo){ @@ -234,7 +236,7 @@ sub construct_paragraph_reg_exp{ $paragraphStopAt = "trailingComment" if($paragraphStopAt eq "comments"); # output to log file - $self->logger("The paragraph-stop regexp WILL include $tokens{$paragraphStopAt} (see paragraphsStopAt)",'heading') if $is_t_switch_active ; + $logger->trace("The paragraph-stop regexp WILL include $tokens{$paragraphStopAt} (see paragraphsStopAt)") if $is_t_switch_active ; # update the regexp if($paragraphStopAt eq "items"){ @@ -243,7 +245,7 @@ sub construct_paragraph_reg_exp{ $stopAtRegExp .= "|(?:".($paragraphStopAt eq "trailingComment" ? "%" : q() ).$tokens{$paragraphStopAt}."\\d+)"; } } else { - $self->logger("The paragraph-stop regexp won't include $tokens{$paragraphStopAt} (see paragraphsStopAt)",'heading') if ($tokens{$paragraphStopAt} and $is_t_switch_active); + $logger->trace("The paragraph-stop regexp won't include $tokens{$paragraphStopAt} (see paragraphsStopAt)") if ($tokens{$paragraphStopAt} and $is_t_switch_active); } } @@ -265,8 +267,8 @@ sub construct_paragraph_reg_exp{ \z # end of string )/sxm; - $self->logger("The paragraph-stop-regexp is:",'heading') if $is_tt_switch_active ; - $self->logger($paragraphRegExp) if $is_tt_switch_active ; + $logger->trace("The paragraph-stop-regexp is:") if $is_tt_switch_active ; + $logger->trace($paragraphRegExp) if $is_tt_switch_active ; } sub paragraphs_on_one_line{ @@ -276,7 +278,7 @@ sub paragraphs_on_one_line{ # alignment at ampersand can take priority return if(${$self}{lookForAlignDelims} and ${$masterSettings{modifyLineBreaks}{removeParagraphLineBreaks}}{alignAtAmpersandTakesPriority}); - $self->logger("Checking ${$self}{name} for paragraphs (see removeParagraphLineBreaks)") if $is_t_switch_active; + $logger->trace("Checking ${$self}{name} for paragraphs (see removeParagraphLineBreaks)") if $is_t_switch_active; my $paragraphCounter; my @paragraphStorage; @@ -296,4 +298,197 @@ sub paragraphs_on_one_line{ } } +sub one_sentence_per_line{ + my $self = shift; + + return unless ${$masterSettings{modifyLineBreaks}{oneSentencePerLine}}{manipulateSentences}; + $logger->trace("*One sentence per line regular expression construction: (see oneSentencePerLine: manipulateSentences)") if $is_t_switch_active; + + # sentences FOLLOW + # sentences FOLLOW + # sentences FOLLOW + my $sentencesFollow = q(); + + while( my ($sentencesFollowEachPart,$yesNo)= each %{${$masterSettings{modifyLineBreaks}{oneSentencePerLine}}{sentencesFollow}}){ + if($yesNo){ + if($sentencesFollowEachPart eq "par"){ + $sentencesFollowEachPart = qr/\R?\\par/s; + } elsif ($sentencesFollowEachPart eq "blankLine"){ + $sentencesFollowEachPart = qr/ + (?:\A(?:$tokens{blanklines}\R)+) # the order of each of these + | # is important, as (like always) the first + (?:\G(?:$tokens{blanklines}\R)+) # thing to be matched will + | # be accepted + (?:(?:$tokens{blanklines}\h*\R)+) + | + \R{2,} + | + \G + /sx; + } elsif ($sentencesFollowEachPart eq "fullStop"){ + $sentencesFollowEachPart = qr/\./s; + } elsif ($sentencesFollowEachPart eq "exclamationMark"){ + $sentencesFollowEachPart = qr/\!/s; + } elsif ($sentencesFollowEachPart eq "questionMark"){ + $sentencesFollowEachPart = qr/\?/s; + } elsif ($sentencesFollowEachPart eq "rightBrace"){ + $sentencesFollowEachPart = qr/\}/s; + } elsif ($sentencesFollowEachPart eq "commentOnPreviousLine"){ + $sentencesFollowEachPart = qr/$trailingCommentRegExp\h*\R/s; + } elsif ($sentencesFollowEachPart eq "other"){ + $sentencesFollowEachPart = qr/$yesNo/; + } + $sentencesFollow .= ($sentencesFollow eq '' ? q() : "|").qr/$sentencesFollowEachPart/sx; + } + } + # if blankLine is not active from sentencesFollow then we need to set up the + # beginning of the string, but make sure that it is *not* followed by a + # blank line token, or a blank line + if(!${${$masterSettings{modifyLineBreaks}{oneSentencePerLine}}{sentencesFollow}}{blankLine}){ + $sentencesFollow .= ($sentencesFollow eq '' ? q() : "|"). + qr/ + \G + (?!$tokens{blanklines}) + /sx; + } + + if(${${$masterSettings{modifyLineBreaks}{oneSentencePerLine}}{sentencesFollow}}{blankLine}){ + $sentencesFollow = ($sentencesFollow eq '' ? q() : qr/(?:$sentencesFollow)(?:\h|\R)*/sx ); + } else { + $sentencesFollow = ($sentencesFollow eq '' ? q() : qr/(?:$sentencesFollow)(?:\h*\R?)/sx ); + } + + + $logger->trace("Sentences follow regexp:") if $is_tt_switch_active; + $logger->trace($sentencesFollow) if $is_tt_switch_active; + + # sentences BEGIN with + # sentences BEGIN with + # sentences BEGIN with + my $sentencesBeginWith = q(); + + while( my ($sentencesBeginWithEachPart,$yesNo)= each %{${$masterSettings{modifyLineBreaks}{oneSentencePerLine}}{sentencesBeginWith}}){ + if($yesNo){ + if($sentencesBeginWithEachPart eq "A-Z"){ + $logger->trace("sentence BEGINS with capital letters (see oneSentencePerLine:sentencesBeginWith:A-Z)") if $is_t_switch_active; + $sentencesBeginWithEachPart = qr/(?!(?:$tokens{blanklines}|$tokens{verbatim}|$tokens{preamble}))[A-Z]/; + } elsif ($sentencesBeginWithEachPart eq "a-z"){ + $logger->trace("sentence BEGINS with lower-case letters (see oneSentencePerLine:sentencesBeginWith:a-z)") if $is_t_switch_active; + $sentencesBeginWithEachPart = qr/[a-z]/; + } elsif ($sentencesBeginWithEachPart eq "other"){ + $logger->trace("sentence BEGINS with other $yesNo (reg exp) (see oneSentencePerLine:sentencesBeginWith:other)") if $is_t_switch_active; + $sentencesBeginWithEachPart = qr/$yesNo/; + } + $sentencesBeginWith .= ($sentencesBeginWith eq "" ? q(): "|" ).$sentencesBeginWithEachPart; + } + } + $sentencesBeginWith = qr/$sentencesBeginWith/; + + # sentences END with + # sentences END with + # sentences END with + ${${$masterSettings{modifyLineBreaks}{oneSentencePerLine}}{sentencesEndWith}}{basicFullStop} = 0 if ${${$masterSettings{modifyLineBreaks}{oneSentencePerLine}}{sentencesEndWith}}{betterFullStop}; + my $sentencesEndWith = q(); + + while( my ($sentencesEndWithEachPart,$yesNo)= each %{${$masterSettings{modifyLineBreaks}{oneSentencePerLine}}{sentencesEndWith}}){ + if($yesNo){ + if($sentencesEndWithEachPart eq "basicFullStop"){ + $logger->trace("sentence ENDS with full stop (see oneSentencePerLine:sentencesEndWith:basicFullStop") if $is_t_switch_active; + $sentencesEndWithEachPart = qr/\./; + } elsif($sentencesEndWithEachPart eq "betterFullStop"){ + $logger->trace("sentence ENDS with *better* full stop (see oneSentencePerLine:sentencesEndWith:betterFullStop") if $is_t_switch_active; + $sentencesEndWithEachPart = qr/(?:\.\)(?!\h*[a-z]))|(?:(?trace("sentence ENDS with exclamation mark (see oneSentencePerLine:sentencesEndWith:exclamationMark)") if $is_t_switch_active; + $sentencesEndWithEachPart = qr/!/; + } elsif ($sentencesEndWithEachPart eq "questionMark"){ + $logger->trace("sentence ENDS with question mark (see oneSentencePerLine:sentencesEndWith:questionMark)") if $is_t_switch_active; + $sentencesEndWithEachPart = qr/\?/; + } elsif ($sentencesEndWithEachPart eq "other"){ + $logger->trace("sentence ENDS with other $yesNo (reg exp) (see oneSentencePerLine:sentencesEndWith:other)") if $is_t_switch_active; + $sentencesEndWithEachPart = qr/$yesNo/; + } + $sentencesEndWith .= ($sentencesEndWith eq "" ? q(): "|" ).$sentencesEndWithEachPart; + } + } + $sentencesEndWith = qr/$sentencesEndWith/; + + # the OVERALL sentence regexp + # the OVERALL sentence regexp + # the OVERALL sentence regexp + $logger->trace("Overall sentences end with regexp:") if $is_tt_switch_active; + $logger->trace($sentencesEndWith) if $is_tt_switch_active; + + $logger->trace("Finding sentences...") if $is_t_switch_active; + + my $notWithinSentence = qr/$trailingCommentRegExp/s; + + # if + # + # modifyLineBreaks + # oneSentencePerLine + # sentencesFollow + # blankLine + # + # is set to 0 then we need to *exclude* the $tokens{blanklines} from the sentence routine, + # otherwise we could begin a sentence with $tokens{blanklines}. + if(!${${$masterSettings{modifyLineBreaks}{oneSentencePerLine}}{sentencesFollow}}{blankLine}){ + $notWithinSentence .= "|".qr/(?:\h*\R?$tokens{blanklines})/s; + } + + # similarly for \par + if(${${$masterSettings{modifyLineBreaks}{oneSentencePerLine}}{sentencesFollow}}{par}){ + $notWithinSentence .= "|".qr/(?:\R?\\par)/s; + } + + # initiate the sentence counter + my $sentenceCounter; + my @sentenceStorage; + + # make the sentence manipulation + ${$self}{body} =~ s/((?:$sentencesFollow)) + (\h*) + (?!$notWithinSentence) + ((?:$sentencesBeginWith).*?) + ($sentencesEndWith)/ + my $beginning = $1; + my $h_space = ($2?$2:q()); + my $middle = $3; + my $end = $4; + my $trailingComments = q(); + # remove trailing comments from within the body of the sentence + while($middle =~ m|$trailingCommentRegExp|){ + $middle =~ s|\h*($trailingCommentRegExp)||s; + $trailingComments .= $1; + } + # remove line breaks from within a sentence + $middle =~ s| + (?!\A) # not at the *beginning* of a match + (\h*)\R # possible horizontal space, then line break + |$1?$1:" ";|esgx if ${$masterSettings{modifyLineBreaks}{oneSentencePerLine}}{removeSentenceLineBreaks}; + $middle =~ s|$tokens{blanklines}\h*\R?|$tokens{blanklines}\n|sg; + $logger->trace("follows: $beginning") if $is_tt_switch_active; + $logger->trace("sentence: $middle") if $is_tt_switch_active; + $logger->trace("ends with: $end") if $is_tt_switch_active; + # reconstruct the sentence + $sentenceCounter++; + push(@sentenceStorage,{id=>$tokens{sentence}.$sentenceCounter.$tokens{endOfToken},value=>$middle.$end}); + $beginning.$h_space.$tokens{sentence}.$sentenceCounter.$tokens{endOfToken}.$trailingComments; + /xsge; + + # loop back through the sentenceStorage and replace with the sentence, adjusting line breaks + # before and after appropriately + while( my $sentence = pop @sentenceStorage){ + my $sentenceStorageID = ${$sentence}{id}; + my $sentenceStorageValue = ${$sentence}{value}; + # sentence at the very END + ${$self}{body} =~ s/\h*$sentenceStorageID\h*$/$sentenceStorageValue/s; + # sentence at the very BEGINNING + ${$self}{body} =~ s/^$sentenceStorageID\h*\R?/$sentenceStorageValue\n/s; + # all other sentences + ${$self}{body} =~ s/\R?\h*$sentenceStorageID\h*\R?/\n$sentenceStorageValue\n/s; + } + +} + 1; diff --git a/LatexIndent/NamedGroupingBracesBrackets.pm b/LatexIndent/NamedGroupingBracesBrackets.pm index d18281f4..22429677 100644 --- a/LatexIndent/NamedGroupingBracesBrackets.pm +++ b/LatexIndent/NamedGroupingBracesBrackets.pm @@ -19,6 +19,7 @@ use warnings; use LatexIndent::Tokens qw/%tokens/; use LatexIndent::TrailingComments qw/$trailingCommentRegExp/; use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/; +use LatexIndent::LogFile qw/$logger/; use Exporter qw/import/; our @ISA = "LatexIndent::Command"; # class inheritance, Programming Perl, pg 321 our @EXPORT_OK = qw/construct_grouping_braces_brackets_regexp $grouping_braces_regexp $grouping_braces_regexpTrailingComment/; @@ -63,7 +64,7 @@ sub get_replacement_text{ my $self = shift; # the replacement text for a key = {value} needes to accomodate the leading [ OR { OR % OR , OR any combination thereof - $self->logger("Custom replacement text routine for ${$self}{name}") if $is_t_switch_active; + $logger->trace("Custom replacement text routine for ${$self}{name}") if $is_t_switch_active; ${$self}{replacementText} = ${$self}{beginningbit}.${$self}{id}; delete ${$self}{beginningbit}; } diff --git a/LatexIndent/OptionalArgument.pm b/LatexIndent/OptionalArgument.pm index a44ca52a..2b18f3c9 100644 --- a/LatexIndent/OptionalArgument.pm +++ b/LatexIndent/OptionalArgument.pm @@ -19,6 +19,7 @@ use warnings; use LatexIndent::Tokens qw/%tokens/; use LatexIndent::TrailingComments qw/$trailingCommentRegExp/; use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/; +use LatexIndent::LogFile qw/$logger/; use Exporter qw/import/; our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321 our @EXPORT_OK = qw/find_optional_arguments/; @@ -46,8 +47,8 @@ sub find_optional_arguments{ # pick out the optional arguments while(${$self}{body} =~ m/$optArgRegExp\h*($trailingCommentRegExp)*(.*)/s){ # log file output - $self->logger("Optional argument found, body in ${$self}{name}",'heading') if $is_t_switch_active; - $self->logger("(last argument)") if($9 eq '' and $is_t_switch_active); + $logger->trace("*Optional argument found, body in ${$self}{name}") if $is_t_switch_active; + $logger->trace("(last argument)") if($9 eq '' and $is_t_switch_active); ${$self}{body} =~ s/ $optArgRegExp(\h*)($trailingCommentRegExp)*(.*) diff --git a/LatexIndent/Preamble.pm b/LatexIndent/Preamble.pm index 178bfe4f..fea38af0 100644 --- a/LatexIndent/Preamble.pm +++ b/LatexIndent/Preamble.pm @@ -19,6 +19,7 @@ use warnings; use LatexIndent::Tokens qw/%tokens/; use LatexIndent::Switches qw/$is_t_switch_active/; use LatexIndent::GetYamlSettings qw/%masterSettings/; +use LatexIndent::LogFile qw/$logger/; our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321 our $preambleCounter; @@ -34,7 +35,7 @@ sub get_replacement_text{ my $self = shift; # the replacement text for preamble needs to put the \\begin{document} back in - $self->logger("Custom replacement text routine for preamble ${$self}{name}") if $is_t_switch_active; + $logger->trace("Custom replacement text routine for preamble ${$self}{name}") if $is_t_switch_active; ${$self}{replacementText} = ${$self}{id}.${$self}{afterbit}; delete ${$self}{afterbit}; } diff --git a/LatexIndent/Special.pm b/LatexIndent/Special.pm index d5a751f9..461c620e 100644 --- a/LatexIndent/Special.pm +++ b/LatexIndent/Special.pm @@ -20,6 +20,7 @@ use LatexIndent::Tokens qw/%tokens/; use LatexIndent::TrailingComments qw/$trailingCommentRegExp/; use LatexIndent::GetYamlSettings qw/%masterSettings/; use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/; +use LatexIndent::LogFile qw/$logger/; use Data::Dumper; use Exporter qw/import/; our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321 @@ -83,7 +84,7 @@ sub construct_special_begin{ /sx } else { - $self->logger("The special regexps won't include anything from $specialName (see lookForThis)",'heading') if $is_t_switch_active ; + $logger->trace("*The special regexps won't include anything from $specialName (see lookForThis)") if $is_t_switch_active ; } } @@ -94,10 +95,12 @@ sub construct_special_begin{ } # info to the log file - $self->logger("The special beginnings regexp is: $specialBegins (see specialBeginEnd)",'heading') if $is_t_switch_active; + $logger->trace("*The special beginnings regexp is: (see specialBeginEnd)") if $is_tt_switch_active; + $logger->trace($specialBegins) if $is_tt_switch_active; # overall special regexp - $self->logger("The overall special regexp is: $specialAllMatchesRegExp(see specialBeginEnd)",'heading') if $is_t_switch_active; + $logger->trace("*The overall special regexp is: (see specialBeginEnd)") if $is_tt_switch_active; + $logger->trace($specialAllMatchesRegExp) if $is_tt_switch_active; } @@ -108,8 +111,8 @@ sub find_special{ return if($specialBegins eq ""); # otherwise loop through the special begin/end - $self->logger("Searching for special begin/end (see specialBeginEnd)") if $is_t_switch_active ; - $self->logger(Dumper(\%{$masterSettings{specialBeginEnd}})) if $is_tt_switch_active; + $logger->trace("*Searching ${$self}{name} for special begin/end (see specialBeginEnd)") if $is_t_switch_active ; + $logger->trace(Dumper(\%{$masterSettings{specialBeginEnd}})) if $is_tt_switch_active; # keep looping as long as there is a special match of some kind while(${$self}{body} =~ m/$specialAllMatchesRegExp/sx){ @@ -119,9 +122,9 @@ sub find_special{ # log file if((ref($BeginEnd) eq "HASH") and ${$BeginEnd}{lookForThis}){ - $self->logger("Looking for $specialName",'heading') if $is_t_switch_active ; + $logger->trace("Looking for $specialName") if $is_t_switch_active ; } else { - $self->logger("Not looking for $specialName (see lookForThis)",'heading') if ($is_t_switch_active and (ref($BeginEnd) eq "HASH")); + $logger->trace("Not looking for $specialName (see lookForThis)") if ($is_t_switch_active and (ref($BeginEnd) eq "HASH")); next; } @@ -134,9 +137,6 @@ sub find_special{ ${$self}{body} =~ s/ $specialRegExp(\h*)($trailingCommentRegExp)? / - # log file output - $self->logger("special found: $specialName",'heading') if $is_t_switch_active; - # create a new special object my $specialObject = LatexIndent::Special->new(begin=>$1, body=>$3, @@ -162,6 +162,9 @@ sub find_special{ horizontalTrailingSpace=>$6?$6:q(), ); + # log file output + $logger->trace("*Special found: $specialName",'heading') if $is_t_switch_active; + # the settings and storage of most objects has a lot in common $self->get_settings_and_store_new_object($specialObject); ${@{${$self}{children}}[-1]}{replacementText}.($8?$8:q()).($9?$9:q()); diff --git a/LatexIndent/Tokens.pm b/LatexIndent/Tokens.pm index a106a09d..2e358e0b 100644 --- a/LatexIndent/Tokens.pm +++ b/LatexIndent/Tokens.pm @@ -18,6 +18,7 @@ use strict; use warnings; use Exporter qw/import/; use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/; +use LatexIndent::LogFile qw/$logger/; our @EXPORT_OK = qw/token_check %tokens/; # each of the tokens begins the same way -- this is exploited during the hidden Children routine @@ -52,17 +53,18 @@ our %tokens = ( doubleBackSlash=>$beginningToken."DOUBLEBACKSLASH", alignmentBlock=>$beginningToken."ALIGNMENTBLOCK", paragraph=>$beginningToken."PARA", + sentence=>$beginningToken."SENTENCE", endOfToken=>"-END", ); sub token_check{ my $self = shift; - $self->logger("Token check",'heading') if $is_t_switch_active; + $logger->trace("*Token check") if $is_t_switch_active; # we use tokens for trailing comments, environments, commands, etc, so check that they're not in the body foreach( keys %tokens){ while(${$self}{body} =~ m/$tokens{$_}/si){ - $self->logger("Found $tokens{$_} within body, updating replacement token to $tokens{$_}-LIN") if($is_t_switch_active); + $logger->trace("Found $tokens{$_} within body, updating replacement token to $tokens{$_}-LIN") if($is_t_switch_active); $tokens{$_} .= "-LIN"; } } diff --git a/LatexIndent/TrailingComments.pm b/LatexIndent/TrailingComments.pm index cbc35f6e..7f2b8e12 100644 --- a/LatexIndent/TrailingComments.pm +++ b/LatexIndent/TrailingComments.pm @@ -19,6 +19,7 @@ use warnings; use LatexIndent::Tokens qw/%tokens/; use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active $is_m_switch_active/; use LatexIndent::GetYamlSettings qw/%masterSettings/; +use LatexIndent::LogFile qw/$logger/; use Data::Dumper; use Exporter qw/import/; our @EXPORT_OK = qw/remove_trailing_comments put_trailing_comments_back_in $trailingCommentRegExp add_comment_symbol construct_trailing_comment_regexp/; @@ -42,8 +43,8 @@ sub add_comment_symbol{ push(@trailingComments,{id=>$tokens{trailingComment}.$commentCounter.$tokens{endOfToken},value=>q()}); # log file info - $self->logger("Updating trailing comment array",'heading')if $is_t_switch_active; - $self->logger(Dumper(\@trailingComments),'ttrace') if($is_tt_switch_active); + $logger->trace("*Updating trailing comment array")if $is_t_switch_active; + $logger->trace(Dumper(\@trailingComments),'ttrace') if($is_tt_switch_active); # the returned value return $tokens{trailingComment}.$commentCounter.$tokens{endOfToken}; @@ -51,7 +52,7 @@ sub add_comment_symbol{ sub remove_trailing_comments{ my $self = shift; - $self->logger("Storing trailing comments",'heading')if $is_t_switch_active; + $logger->trace("*Storing trailing comments")if $is_t_switch_active; # perform the substitution ${$self}{body} =~ s/ @@ -71,10 +72,10 @@ sub remove_trailing_comments{ "%".$tokens{trailingComment}.$commentCounter.$tokens{endOfToken}; /xsmeg; if(@trailingComments){ - $self->logger("Trailing comments stored in:") if($is_t_switch_active); - $self->logger(Dumper(\@trailingComments)) if($is_t_switch_active); + $logger->trace("Trailing comments stored in:") if($is_tt_switch_active); + $logger->trace(Dumper(\@trailingComments)) if($is_tt_switch_active); } else { - $self->logger("No trailing comments found") if($is_t_switch_active); + $logger->trace("No trailing comments found") if($is_t_switch_active); } return; } @@ -83,7 +84,7 @@ sub put_trailing_comments_back_in{ my $self = shift; return unless( @trailingComments > 0 ); - $self->logger("Returning trailing comments to body",'heading')if $is_t_switch_active; + $logger->trace("*Returning trailing comments to body")if $is_t_switch_active; # loop through trailing comments in reverse so that, for example, # latexindenttrailingcomment1 doesn't match the first @@ -95,7 +96,7 @@ sub put_trailing_comments_back_in{ # the -m switch can modify max characters per line, and trailing comment IDs can # be split across lines if($is_m_switch_active and ${$self}{body} !~ m/%$trailingcommentID/m){ - $self->logger("$trailingcommentID not found in body using /m matching, assuming it has been split across line (see modifyLineBreaks: textWrapOptions)") if($is_t_switch_active); + $logger->trace("$trailingcommentID not found in body using /m matching, assuming it has been split across line (see modifyLineBreaks: textWrapOptions)") if($is_t_switch_active); my $trailingcommentIDwithLineBreaks; # construct a reg exp that contains possible line breaks in between each character @@ -107,7 +108,7 @@ sub put_trailing_comments_back_in{ my $trailingcommentIDwithLineBreaksRegExp = qr/$trailingcommentIDwithLineBreaks/s; # replace the line-broken trailing comment ID with a non-broken trailing comment ID - ${$self}{body} =~ s/%$trailingcommentIDwithLineBreaksRegExp/%$trailingcommentID/s; + ${$self}{body} =~ s/%\R?$trailingcommentIDwithLineBreaksRegExp/%$trailingcommentID/s; } if(${$self}{body} =~ m/%$trailingcommentID ( @@ -118,12 +119,12 @@ sub put_trailing_comments_back_in{ ) # captured into $1 (\h*)?$ /mx and $1 ne ''){ - $self->logger("Comment not at end of line $trailingcommentID, moving it to end of line")if $is_t_switch_active; + $logger->trace("Comment not at end of line $trailingcommentID, moving it to end of line")if $is_t_switch_active; ${$self}{body} =~ s/%$trailingcommentID(.*)$/$1%$trailingcommentValue/m; } else { ${$self}{body} =~ s/%$trailingcommentID/%$trailingcommentValue/; } - $self->logger("replace %$trailingcommentID with %$trailingcommentValue") if($is_t_switch_active); + $logger->trace("replace %$trailingcommentID with %$trailingcommentValue") if($is_tt_switch_active); } return; } diff --git a/LatexIndent/UnNamedGroupingBracesBrackets.pm b/LatexIndent/UnNamedGroupingBracesBrackets.pm index 30c96907..0c184846 100644 --- a/LatexIndent/UnNamedGroupingBracesBrackets.pm +++ b/LatexIndent/UnNamedGroupingBracesBrackets.pm @@ -19,6 +19,7 @@ use warnings; use LatexIndent::Tokens qw/%tokens/; use LatexIndent::TrailingComments qw/$trailingCommentRegExp/; use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/; +use LatexIndent::LogFile qw/$logger/; use Exporter qw/import/; our @ISA = "LatexIndent::Command"; # class inheritance, Programming Perl, pg 321 our @EXPORT_OK = qw/construct_unnamed_grouping_braces_brackets_regexp $un_named_grouping_braces_RegExp $un_named_grouping_braces_RegExp_trailing_comment/; @@ -76,7 +77,7 @@ sub get_replacement_text{ my $self = shift; # the replacement text for a key = {value} needes to accomodate the leading [ OR { OR % OR , OR any combination thereof - $self->logger("Custom replacement text routine for ${$self}{name}") if $is_t_switch_active; + $logger->trace("Custom replacement text routine for ${$self}{name}") if $is_t_switch_active; # the un-named object is a little special, as it doesn't have a name; as such, if there are blank lines before # the braces/brackets, we have to insert them @@ -89,7 +90,7 @@ sub get_replacement_text{ # but now turn off the switch for linebreaksAtEnd{begin}, otherwise the first brace gets too much indentation # (see, for example, test-cases/namedGroupingBracesBrackets/special-characters-minimal.tex) ${${$self}{linebreaksAtEnd}}{begin} = 0; - $self->logger("Beginning bit is: ${$self}{beginningbit}") if($is_t_switch_active); + $logger->trace("Beginning bit is: ${$self}{beginningbit}") if($is_t_switch_active); delete ${$self}{beginningbit}; } diff --git a/LatexIndent/Verbatim.pm b/LatexIndent/Verbatim.pm index 909b33cf..c79d9604 100644 --- a/LatexIndent/Verbatim.pm +++ b/LatexIndent/Verbatim.pm @@ -16,11 +16,12 @@ package LatexIndent::Verbatim; # For all communication, please visit: https://github.com/cmhughes/latexindent.pl use strict; use warnings; +use Data::Dumper; +use Exporter qw/import/; use LatexIndent::Tokens qw/%tokens/; use LatexIndent::GetYamlSettings qw/%masterSettings/; use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active $is_m_switch_active/; -use Data::Dumper; -use Exporter qw/import/; +use LatexIndent::LogFile qw/$logger/; our @EXPORT_OK = qw/put_verbatim_back_in find_verbatim_environments find_noindent_block find_verbatim_commands put_verbatim_commands_back_in/; our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321 our $verbatimCounter; @@ -29,11 +30,11 @@ sub find_noindent_block{ my $self = shift; # noindent block - $self->logger('looking for NOINDENTBLOCk environments (see noIndentBlock)','heading') if $is_t_switch_active; - $self->logger(Dumper(\%{$masterSettings{noIndentBlock}})) if($is_t_switch_active); + $logger->trace('*Searching for NOINDENTBLOCk environments (see noIndentBlock)') if $is_t_switch_active; + $logger->trace(Dumper(\%{$masterSettings{noIndentBlock}})) if($is_tt_switch_active); while( my ($noIndentBlock,$yesno)= each %{$masterSettings{noIndentBlock}}){ if($yesno){ - $self->logger("looking for $noIndentBlock:$yesno environments") if $is_t_switch_active; + $logger->trace("looking for $noIndentBlock:$yesno environments") if $is_t_switch_active; my $noIndentRegExp = qr/ ( @@ -58,28 +59,31 @@ sub find_noindent_block{ while( ${$self}{body} =~ m/$noIndentRegExp/sx){ # create a new Environment object - my $noIndentBlock = LatexIndent::Verbatim->new( begin=>$1, + my $noIndentBlockObj = LatexIndent::Verbatim->new( begin=>$1, body=>$2, end=>$3, name=>$noIndentBlock, ); # give unique id - $noIndentBlock->create_unique_id; + $noIndentBlockObj->create_unique_id; # verbatim children go in special hash - ${$self}{verbatim}{${$noIndentBlock}{id}}=$noIndentBlock; + ${$self}{verbatim}{${$noIndentBlockObj}{id}}=$noIndentBlockObj; # log file output - $self->logger("NOINDENTBLOCK environment found: $noIndentBlock") if $is_t_switch_active; + $logger->trace("*NOINDENTBLOCK environment found: $noIndentBlock") if $is_t_switch_active; # remove the environment block, and replace with unique ID - ${$self}{body} =~ s/$noIndentRegExp/${$noIndentBlock}{id}/sx; + ${$self}{body} =~ s/$noIndentRegExp/${$noIndentBlockObj}{id}/sx; - $self->logger("replaced with ID: ${$noIndentBlock}{id}") if $is_t_switch_active; + $logger->trace("replaced with ID: ${$noIndentBlockObj}{id}") if $is_t_switch_active; + + # possible decoration in log file + $logger->trace(${$masterSettings{logFilePreferences}}{showDecorationFinishCodeBlockTrace}) if ${$masterSettings{logFilePreferences}}{showDecorationFinishCodeBlockTrace}; } } else { - $self->logger("*not* looking for $noIndentBlock as $noIndentBlock:$yesno") if $is_t_switch_active; + $logger->trace("*not* looking for $noIndentBlock as $noIndentBlock:$yesno") if $is_t_switch_active; } } return; @@ -89,11 +93,11 @@ sub find_verbatim_environments{ my $self = shift; # verbatim environments - $self->logger('looking for VERBATIM environments (see verbatimEnvironments)','heading') if $is_t_switch_active; - $self->logger(Dumper(\%{$masterSettings{verbatimEnvironments}})) if($is_t_switch_active); + $logger->trace('*Searching for VERBATIM environments (see verbatimEnvironments)') if $is_t_switch_active; + $logger->trace(Dumper(\%{$masterSettings{verbatimEnvironments}})) if($is_tt_switch_active); while( my ($verbEnv,$yesno)= each %{$masterSettings{verbatimEnvironments}}){ if($yesno){ - $self->logger("looking for $verbEnv:$yesno environments") if $is_t_switch_active; + $logger->trace("looking for $verbEnv:$yesno environments") if $is_t_switch_active; my $verbatimRegExp = qr/ ( @@ -124,15 +128,18 @@ sub find_verbatim_environments{ ${$self}{verbatim}{${$verbatimBlock}{id}}=$verbatimBlock; # log file output - $self->logger("VERBATIM environment found: $verbEnv") if $is_t_switch_active; + $logger->trace("*VERBATIM environment found: $verbEnv") if $is_t_switch_active; # remove the environment block, and replace with unique ID ${$self}{body} =~ s/$verbatimRegExp/${$verbatimBlock}{id}/sx; - $self->logger("replaced with ID: ${$verbatimBlock}{id}") if $is_t_switch_active; + $logger->trace("replaced with ID: ${$verbatimBlock}{id}") if $is_t_switch_active; + + # possible decoration in log file + $logger->trace(${$masterSettings{logFilePreferences}}{showDecorationFinishCodeBlockTrace}) if ${$masterSettings{logFilePreferences}}{showDecorationFinishCodeBlockTrace}; } } else { - $self->logger("*not* looking for $verbEnv as $verbEnv:$yesno") if $is_t_switch_active; + $logger->trace("*not* looking for $verbEnv as $verbEnv:$yesno") if $is_t_switch_active; } } return; @@ -146,11 +153,11 @@ sub find_verbatim_commands{ # would need to be found *before* trailing comments have been removed. Similarly, # verbatim commands need to be put back in *after* trailing comments have been put # back in - $self->logger('looking for VERBATIM commands (see verbatimCommands)','heading') if $is_t_switch_active; - $self->logger(Dumper(\%{$masterSettings{verbatimCommands}})) if($is_tt_switch_active); + $logger->trace('*Searching for VERBATIM commands (see verbatimCommands)') if $is_t_switch_active; + $logger->trace(Dumper(\%{$masterSettings{verbatimCommands}})) if($is_tt_switch_active); while( my ($verbCommand,$yesno)= each %{$masterSettings{verbatimCommands}}){ if($yesno){ - $self->logger("looking for $verbCommand:$yesno Commands") if $is_t_switch_active; + $logger->trace("looking for $verbCommand:$yesno Commands") if $is_t_switch_active; my $verbatimCommandRegExp = qr/ ( @@ -190,21 +197,24 @@ sub find_verbatim_commands{ $verbatimCommand->create_unique_id; # output, if desired - $self->logger(Dumper($verbatimCommand),'ttrace') if($is_tt_switch_active); + $logger->trace(Dumper($verbatimCommand),'ttrace') if($is_tt_switch_active); # verbatim children go in special hash ${$self}{verbatimCommands}{${$verbatimCommand}{id}}=$verbatimCommand; # log file output - $self->logger("VERBATIM command found: $verbCommand") if $is_t_switch_active; + $logger->trace("*VERBATIM command found: $verbCommand") if $is_t_switch_active; # remove the environment block, and replace with unique ID ${$self}{body} =~ s/$verbatimCommandRegExp/${$verbatimCommand}{id}/sx; - $self->logger("replaced with ID: ${$verbatimCommand}{id}") if $is_t_switch_active; + $logger->trace("replaced with ID: ${$verbatimCommand}{id}") if $is_t_switch_active; + + # possible decoration in log file + $logger->trace(${$masterSettings{logFilePreferences}}{showDecorationFinishCodeBlockTrace}) if ${$masterSettings{logFilePreferences}}{showDecorationFinishCodeBlockTrace}; } } else { - $self->logger("*not* looking for $verbCommand as $verbCommand:$yesno") if $is_t_switch_active; + $logger->trace("*not* looking for $verbCommand as $verbCommand:$yesno") if $is_t_switch_active; } } return; @@ -218,8 +228,8 @@ sub put_verbatim_back_in { return unless(${$self}{verbatim}); # search for environments/commands - $self->logger('Putting verbatim back in, here is the pre-processed body:','heading') if $is_t_switch_active; - $self->logger(${$self}{body}) if($is_t_switch_active); + $logger->trace('*Putting verbatim back in, here is the pre-processed body:') if $is_tt_switch_active; + $logger->trace(${$self}{body}) if($is_tt_switch_active); # loop through document children hash while( (scalar keys %{${$self}{verbatim}})>0 ){ @@ -230,14 +240,13 @@ sub put_verbatim_back_in { ${$self}{body} =~ s/${$child}{id}/${$child}{begin}${$child}{body}${$child}{end}/; # log file info - $self->logger('Body now looks like:','heading') if $is_tt_switch_active; - $self->logger(${$self}{body},'ttrace') if($is_tt_switch_active); + $logger->trace('Body now looks like:') if $is_tt_switch_active; + $logger->trace(${$self}{body},'ttrace') if($is_tt_switch_active); # delete the hash so it won't be operated upon again delete ${$self}{verbatim}{${$child}{id}}; - $self->logger("deleted key") if $is_t_switch_active; } elsif ($is_m_switch_active and ${$masterSettings{modifyLineBreaks}{textWrapOptions}}{columns}>1 and ${$self}{body} !~ m/${$child}{id}/){ - $self->logger("${$child}{id} not found in body using /m matching, it may have been split across line (see modifyLineBreaks: textWrapOptions)") if($is_t_switch_active); + $logger->trace("${$child}{id} not found in body using /m matching, it may have been split across line (see modifyLineBreaks: textWrapOptions)") if($is_t_switch_active); # search for a version of the verbatim ID that may have line breaks my $verbatimIDwithLineBreaks = join("\\R?",split(//,${$child}{id})); @@ -250,10 +259,8 @@ sub put_verbatim_back_in { } # logfile info - $self->logger("Number of children:",'heading') if $is_t_switch_active; - $self->logger(scalar keys %{${$self}{verbatim}}) if $is_t_switch_active; - $self->logger('Post-processed body:','heading') if $is_t_switch_active; - $self->logger(${$self}{body}) if($is_t_switch_active); + $logger->trace('*Post-processed body:') if $is_tt_switch_active; + $logger->trace(${$self}{body}) if($is_tt_switch_active); return; } @@ -264,8 +271,8 @@ sub put_verbatim_commands_back_in { return unless(${$self}{verbatimCommands}); # search for environments/commands - $self->logger('Putting verbatim commands back in, here is the pre-processed body:','heading') if $is_t_switch_active; - $self->logger(${$self}{body}) if($is_t_switch_active); + $logger->trace('*Putting verbatim commands back in, here is the pre-processed body:') if $is_tt_switch_active; + $logger->trace(${$self}{body}) if($is_tt_switch_active); # loop through document children hash while( (scalar keys %{${$self}{verbatimCommands}})>0 ){ @@ -276,14 +283,13 @@ sub put_verbatim_commands_back_in { ${$self}{body} =~ s/${$child}{id}/${$child}{begin}${$child}{body}${$child}{end}/; # log file info - $self->logger('Body now looks like:','heading') if $is_tt_switch_active; - $self->logger(${$self}{body},'ttrace') if($is_tt_switch_active); + $logger->trace('Body now looks like:') if $is_tt_switch_active; + $logger->trace(${$self}{body},'ttrace') if($is_tt_switch_active); # delete the hash so it won't be operated upon again delete ${$self}{verbatimCommands}{${$child}{id}}; - $self->logger("deleted key") if $is_t_switch_active; } elsif ($is_m_switch_active and ${$masterSettings{modifyLineBreaks}{textWrapOptions}}{columns}>1 and ${$self}{body} !~ m/${$child}{id}/){ - $self->logger("${$child}{id} not found in body using /m matching, it may have been split across line (see modifyLineBreaks: textWrapOptions)") if($is_t_switch_active); + $logger->trace("${$child}{id} not found in body using /m matching, it may have been split across line (see modifyLineBreaks: textWrapOptions)") if($is_t_switch_active); # search for a version of the verbatim ID that may have line breaks my $verbatimIDwithLineBreaks = join("\\R?",split(//,${$child}{id})); @@ -296,10 +302,8 @@ sub put_verbatim_commands_back_in { } # logfile info - $self->logger("Number of children:",'heading'); - $self->logger(scalar keys %{${$self}{verbatimCommands}}); - $self->logger('Post-processed body:','heading') if $is_t_switch_active; - $self->logger(${$self}{body}) if($is_t_switch_active); + $logger->trace('*Post-processed body:') if $is_tt_switch_active; + $logger->trace(${$self}{body}) if($is_tt_switch_active); return; } diff --git a/LatexIndent/Version.pm b/LatexIndent/Version.pm index 260f1f12..8a8c41b7 100644 --- a/LatexIndent/Version.pm +++ b/LatexIndent/Version.pm @@ -19,6 +19,6 @@ use warnings; use Exporter qw/import/; our @EXPORT_OK = qw/$versionNumber $versionDate/; -our $versionNumber = '3.3'; -our $versionDate = '2017-08-21'; +our $versionNumber = '3.4'; +our $versionDate = '2018-01-13'; 1 diff --git a/defaultSettings.yaml b/defaultSettings.yaml index 97c63d7e..53848520 100644 --- a/defaultSettings.yaml +++ b/defaultSettings.yaml @@ -1,4 +1,4 @@ -# defaultSettings.yaml for latexindent.pl, version 3.3, 2017-08-21 +# defaultSettings.yaml for latexindent.pl, version 3.4, 2018-01-13 # a script that aims to # beautify .tex, .sty, .cls files # @@ -79,8 +79,14 @@ cycleThroughBackUps: 0 logFilePreferences: showEveryYamlRead: 1 showAmalgamatedSettings: 0 + showDecorationStartCodeBlockTrace: 0 + showDecorationFinishCodeBlockTrace: 0 endLogFileWith: '--------------' showGitHubInfoFooter: 1 + PatternLayout: + default: "%A%n" + trace: "%A%n" + ttrace: "%A%n" # verbatim environments- environments specified # in this hash table will not be changed at all! @@ -139,9 +145,12 @@ lookForAlignDelims: tabular: delims: 1 alignDoubleBackSlash: 1 - spacesBeforeDoubleBackSlash: 2 + spacesBeforeDoubleBackSlash: 1 multiColumnGrouping: 0 alignRowsWithoutMaxDelims: 1 + spacesBeforeAmpersand: 1 + spacesAfterAmpersand: 1 + justification: "left" tabularx: delims: 1 longtable: 1 @@ -385,6 +394,28 @@ modifyLineBreaks: textWrapOptions: columns: 0 separator: "" + oneSentencePerLine: + manipulateSentences: 0 + removeSentenceLineBreaks: 1 + sentencesFollow: + par: 1 + blankLine: 1 + fullStop: 1 + exclamationMark: 1 + questionMark: 1 + rightBrace: 1 + commentOnPreviousLine: 1 + other: 0 + sentencesBeginWith: + A-Z: 1 + a-z: 0 + other: 0 + sentencesEndWith: + basicFullStop: 0 + betterFullStop: 1 + exclamationMark: 1 + questionMark: 1 + other: 0 removeParagraphLineBreaks: all: 0 alignAtAmpersandTakesPriority: 1 diff --git a/documentation/appendices.tex b/documentation/appendices.tex index 1f6f1465..e2e68c1f 100644 --- a/documentation/appendices.tex +++ b/documentation/appendices.tex @@ -3,9 +3,9 @@ \section{Required \texttt{Perl} modules}\label{sec:requiredmodules} If you intend to use \texttt{latexindent.pl} and \emph{not} one of the supplied standalone executable files, then you will need a few standard Perl modules -- if you can run the minimum code in \cref{lst:helloworld} (\texttt{perl helloworld.pl}) then you will be able to run \texttt{latexindent.pl}, otherwise you may - need to install the missing modules. + need to install the missing modules -- see \cref{sec:module-installer,sec:manual-module-instal}. - \begin{cmhlistings}[language=Perl]{\texttt{helloworld.pl}}{lst:helloworld} + \begin{cmhlistings}[style=tcblatex,language=Perl]{\texttt{helloworld.pl}}{lst:helloworld} #!/usr/bin/perl use strict; @@ -23,42 +23,62 @@ use File::HomeDir; use Getopt::Long; use Data::Dumper; +use List::Util qw(max); +use Log::Log4perl qw(get_logger :levels); print "hello world"; exit; \end{cmhlistings} - Installing the modules given in \cref{lst:helloworld} will vary depending on your - operating system and \texttt{Perl} distribution. For example, Ubuntu users - might visit the software center, or else run - \begin{commandshell} + + \subsection{Module installer script}\label{sec:module-installer} + \announce{NEW}{perl module helper script} \texttt{latexindent.pl} ships with a helper script that will install any missing \texttt{perl} modules + on your system; if you run + \begin{commandshell} +perl latexindent-module-installer.pl + \end{commandshell} + or + \begin{dosprompt} +perl latexindent-module-installer.pl + \end{dosprompt} + then, once you have answered \texttt{Y}, the appropriate modules will be installed onto your distribution. + + \subsection{Manually installed modules}\label{sec:manual-module-instal} + Manually installing the modules given in \cref{lst:helloworld} will vary depending on your + operating system and \texttt{Perl} distribution. For example, Ubuntu users + might visit the software center, or else run + \begin{commandshell} sudo perl -MCPAN -e 'install "File::HomeDir"' \end{commandshell} - Linux users may be interested in exploring Perlbrew \cite{perlbrew}; possible installation and setup - options follow for Ubuntu (other distributions will need slightly different commands). - \begin{commandshell} + Linux users may be interested in exploring Perlbrew \cite{perlbrew}; possible installation and setup + options follow for Ubuntu (other distributions will need slightly different commands). + \begin{commandshell} sudo apt-get install perlbrew -perlbrew install perl-5.20.1 -perlbrew switch perl-5.20.1 +perlbrew install perl-5.22.1 +perlbrew switch perl-5.22.1 sudo apt-get install curl curl -L http://cpanmin.us | perl - App::cpanminus cpanm YAML::Tiny cpanm File::HomeDir +cpanm Unicode::GCString +cpanm Log::Log4perl +cpanm Log::Dispatch \end{commandshell} - Strawberry Perl users on Windows might use - \texttt{CPAN client}. All of the modules are readily available on CPAN \cite{cpan}. + Strawberry Perl users on Windows might use + \texttt{CPAN client}. All of the modules are readily available on CPAN \cite{cpan}. - \texttt{indent.log} will contain details of the location - of the Perl modules on your system. \texttt{latexindent.exe} is a standalone - executable for Windows (and therefore does not require a Perl distribution) and caches copies of the Perl modules onto your system; if you - wish to see where they are cached, use the \texttt{trace} option, e.g - \begin{dosprompt} + \texttt{indent.log} will contain details of the location + of the Perl modules on your system. \texttt{latexindent.exe} is a standalone + executable for Windows (and therefore does not require a Perl distribution) and caches copies of the Perl modules onto your system; if you + wish to see where they are cached, use the \texttt{trace} option, e.g + \begin{dosprompt} latexindent.exe -t myfile.tex \end{dosprompt} \section{Updating the \texttt{path} variable}\label{sec:updating-path} - \texttt{latexindent.pl} has a few scripts (available at \cite{latexindent-home}) that can update the \texttt{path} variables\footnote{Thanks to \cite{jasjuang} for this feature!}. If you're + \texttt{latexindent.pl} has a few scripts (available at \cite{latexindent-home}) that can update the \texttt{path} variables. + Thank you to \cite{jasjuang} for this feature. If you're on a Linux or Mac machine, then you'll want \texttt{CMakeLists.txt} from \cite{latexindent-home}. \subsection{Add to path for Linux} To add \texttt{latexindent.pl} to the path for Linux, follow these steps: @@ -110,6 +130,42 @@ \end{enumerate} To \emph{remove} the directory from your \lstinline!%path%!, run \texttt{remove-from-path.bat} as administrator. + \section{\texttt{logFilePreferences}}\label{app:logfile-demo} + \Vref{lst:logFilePreferences} describes the options for customising the information given + to the log file, and we provide a few demonstrations here. Let's say that we start with the code + given in \cref{lst:simple}, and the settings specified in \cref{lst:logfile-prefs1-yaml}. + + \begin{minipage}{.35\linewidth} + \cmhlistingsfromfile*{demonstrations/simple.tex}{\texttt{simple.tex}}{lst:simple} + \end{minipage} + \hfill + \begin{minipage}{.6\linewidth} + \cmhlistingsfromfile*{demonstrations/logfile-prefs1.yaml}[yaml-TCB]{\texttt{logfile-prefs1.yaml}}{lst:logfile-prefs1-yaml} + \end{minipage} + + If we run the following command (noting that \texttt{-t} is active) + \begin{commandshell} +latexindent.pl -t -l=logfile-prefs1.yaml simple.tex + \end{commandshell} + then on inspection of \texttt{indent.log} we will find the snippet given in \cref{lst:indentlog}. + \begin{cmhlistings}[style=tcblatex,morekeywords={TRACE}]{\texttt{indent.log}}{lst:indentlog} + +++++ +TRACE: environment found: myenv + No ancestors found for myenv + Storing settings for myenvenvironments + indentRulesGlobal specified (0) for environments, ... + Using defaultIndent for myenv + Putting linebreak after replacementText for myenv + looking for COMMANDS and key = {value} +TRACE: Searching for commands with optional and/or mandatory arguments AND key = {value} + looking for SPECIAL begin/end +TRACE: Searching myenv for special begin/end (see specialBeginEnd) +TRACE: Searching myenv for optional and mandatory arguments + ... no arguments found + ----- + \end{cmhlistings} + Notice that the information given about \texttt{myenv} is `framed' using \texttt{+++++} and \lstinline!-----! respectively. + \section{Differences from Version 2.2 to 3.0}\label{app:differences} There are a few (small) changes to the interface when comparing Version 2.2 to Version 3.0. Explicitly, in previous versions you might have run, for example, @@ -189,6 +245,6 @@ \mbox{}\hfill \begin{minipage}{.25\textwidth} \hrule - \hfill\itshape End + \hfill\itshape End\\\mbox{}\hfill\mbox{}\rlap{\hfill\includegraphics{logo}} \end{minipage} diff --git a/documentation/checklogfile.sh b/documentation/checklogfile.sh new file mode 100755 index 00000000..75d79289 --- /dev/null +++ b/documentation/checklogfile.sh @@ -0,0 +1,8 @@ +#!/bin/bash +# check for undefined/multiply-defined references + +set -x +egrep -i --color=auto 'undefined' latexindent.log +egrep -i --color=auto 'multiply-defined' latexindent.log +egrep -i --color=auto 'fixthis' latexindent.log +exit diff --git a/documentation/contributors.bib b/documentation/contributors.bib index 308bfa6a..fe6f9a82 100644 --- a/documentation/contributors.bib +++ b/documentation/contributors.bib @@ -47,3 +47,10 @@ @online{paulo date={2013-05-23}, urldate= {2017-01-23}, keywords={contributor},} +@online{mlep, + title="One sentence per line", + url="https://github.com/cmhughes/latexindent.pl/issues/81", + date={2017-08-16}, + author="mlep", + urldate= {2018-01-08}, + keywords={contributor},} diff --git a/documentation/demonstrations/alt-full-stop1.yaml b/documentation/demonstrations/alt-full-stop1.yaml new file mode 100644 index 00000000..d95d0c09 --- /dev/null +++ b/documentation/demonstrations/alt-full-stop1.yaml @@ -0,0 +1,6 @@ +modifyLineBreaks: + oneSentencePerLine: + manipulateSentences: 1 + sentencesEndWith: + basicFullStop: 1 + betterFullStop: 0 diff --git a/documentation/demonstrations/documentation-test-cases.sh b/documentation/demonstrations/documentation-test-cases.sh index ec46c3d4..a8c38980 100755 --- a/documentation/demonstrations/documentation-test-cases.sh +++ b/documentation/demonstrations/documentation-test-cases.sh @@ -17,11 +17,17 @@ latexindent.pl -s pstricks.tex --outputfile pstricks-default.tex -logfile cmh.lo latexindent.pl -s tabular1.tex --outputfile tabular1-default.tex -logfile cmh.log latexindent.pl -s -l tabular.yaml tabular1.tex --outputfile tabular1-advanced.tex latexindent.pl -s -l tabular1.yaml tabular1.tex --outputfile tabular1-advanced-3spaces.tex -latexindent.pl -s matrix1.tex -o matrix1-default.tex +latexindent.pl -s matrix1.tex -o=+-default.tex +latexindent.pl -s matrix2.tex -o=+-default.tex latexindent.pl -s align-block.tex -o align-block-default.tex latexindent.pl -s tabular2.tex -o tabular2-default.tex -latexindent.pl -s tabular2.tex -o tabular2-mc.tex -l tabular2.yaml -latexindent.pl -s tabular2.tex -o tabular2-no-max.tex -l tabular3.yaml +latexindent.pl -s tabular2.tex -o=+-mod2 -l tabular2.yaml +latexindent.pl -s tabular2.tex -o=+-mod3 -l tabular3.yaml +latexindent.pl -s tabular2.tex -o=+-mod4 -l tabular2,tabular4.yaml +latexindent.pl -s tabular2.tex -o=+-mod5 -l tabular2,tabular5.yaml +latexindent.pl -s tabular2.tex -o=+-mod6 -l tabular2,tabular6.yaml +latexindent.pl -s tabular2.tex -o=+-mod7 -l tabular2,tabular7.yaml +latexindent.pl -s tabular2.tex -o=+-mod8 -l tabular2,tabular8.yaml # items latexindent.pl -s items1.tex -o items1-default.tex @@ -207,5 +213,22 @@ latexindent.pl -s -m env-mlb7 -o=+-no-preserve -l=env-mlb12.yaml,env-mlb13.yaml, # special before command latexindent.pl -s specialLR.tex -l specialsLeftRight.yaml -o=+-comm-first latexindent.pl -s specialLR.tex -l specialsLeftRight.yaml,specialBeforeCommand.yaml -o=+-special-first + +# one sentence per line +latexindent.pl -s multiple-sentences -m -l=manipulate-sentences.yaml -o=+-mod1 +latexindent.pl -s multiple-sentences -m -l=keep-sen-line-breaks.yaml -o=+-mod2 +latexindent.pl -s multiple-sentences -m -l=sentences-follow1.yaml -o=+-mod3 +latexindent.pl -s multiple-sentences -m -l=sentences-end1.yaml -o=+-mod4 +latexindent.pl -s multiple-sentences -m -l=sentences-end2.yaml -o=+-mod5 +latexindent.pl -s multiple-sentences1 -m -l=manipulate-sentences.yaml -o=+-mod1 +latexindent.pl -s multiple-sentences1 -m -l=manipulate-sentences.yaml,sentences-follow2.yaml -o=+-mod2 +latexindent.pl -s multiple-sentences2 -m -l=manipulate-sentences.yaml -o=+-mod1 +latexindent.pl -s multiple-sentences2 -m -l=manipulate-sentences.yaml,sentences-begin1 -o=+-mod2 +latexindent.pl -s multiple-sentences3 -m -l=manipulate-sentences.yaml -o=+-mod1 +latexindent.pl -s multiple-sentences4 -m -l=manipulate-sentences.yaml -o=+-mod1 +latexindent.pl -s multiple-sentences4 -m -l=keep-sen-line-breaks.yaml -o=+-mod2 +latexindent.pl -s multiple-sentences4 -m -l=item-rules2 -o=+-mod3 +latexindent.pl -s url.tex -m -l=manipulate-sentences.yaml -o=+-mod1 +latexindent.pl -s url.tex -m -l=alt-full-stop1 -o=+-mod2 [[ $noisyMode == 1 ]] && makenoise git status diff --git a/documentation/demonstrations/item-rules2.yaml b/documentation/demonstrations/item-rules2.yaml new file mode 100644 index 00000000..519fce0a --- /dev/null +++ b/documentation/demonstrations/item-rules2.yaml @@ -0,0 +1,10 @@ +modifyLineBreaks: + oneSentencePerLine: + manipulateSentences: 1 + items: + ItemStartsOnOwnLine: 1 + environments: + BeginStartsOnOwnLine: 1 + BodyStartsOnOwnLine: 1 + EndStartsOnOwnLine: 1 + EndFinishesWithLineBreak: 1 diff --git a/documentation/demonstrations/keep-sen-line-breaks.yaml b/documentation/demonstrations/keep-sen-line-breaks.yaml new file mode 100644 index 00000000..eb09b0e2 --- /dev/null +++ b/documentation/demonstrations/keep-sen-line-breaks.yaml @@ -0,0 +1,4 @@ +modifyLineBreaks: + oneSentencePerLine: + manipulateSentences: 1 + removeSentenceLineBreaks: 0 diff --git a/documentation/demonstrations/logfile-prefs1.yaml b/documentation/demonstrations/logfile-prefs1.yaml new file mode 100644 index 00000000..9a4975e9 --- /dev/null +++ b/documentation/demonstrations/logfile-prefs1.yaml @@ -0,0 +1,3 @@ +logFilePreferences: + showDecorationStartCodeBlockTrace: "+++++" + showDecorationFinishCodeBlockTrace: "-----" diff --git a/documentation/demonstrations/manipulate-sentences.yaml b/documentation/demonstrations/manipulate-sentences.yaml new file mode 100644 index 00000000..1b5cc532 --- /dev/null +++ b/documentation/demonstrations/manipulate-sentences.yaml @@ -0,0 +1,3 @@ +modifyLineBreaks: + oneSentencePerLine: + manipulateSentences: 1 diff --git a/documentation/demonstrations/matrix2-default.tex b/documentation/demonstrations/matrix2-default.tex new file mode 100644 index 00000000..9fd35ee8 --- /dev/null +++ b/documentation/demonstrations/matrix2-default.tex @@ -0,0 +1,4 @@ +\matrix (A){ + c01 & c02 & c03 & c0q \\ + c_{11} & c12 & \ldots & c1q \\ +}; diff --git a/documentation/demonstrations/matrix2.tex b/documentation/demonstrations/matrix2.tex new file mode 100644 index 00000000..ea80b43b --- /dev/null +++ b/documentation/demonstrations/matrix2.tex @@ -0,0 +1,4 @@ +\matrix (A){ +c01 & c02 & c03 & c0q \\ +c_{11} & c12 & \ldots & c1q \\ +}; diff --git a/documentation/demonstrations/multiple-sentences-mod1.tex b/documentation/demonstrations/multiple-sentences-mod1.tex new file mode 100644 index 00000000..6c77eed9 --- /dev/null +++ b/documentation/demonstrations/multiple-sentences-mod1.tex @@ -0,0 +1,7 @@ +This is the first sentence. +This is the; second, sentence. +This is the third sentence. + +This is the fourth sentence! +This is the fifth sentence? +This is the sixth sentence. diff --git a/documentation/demonstrations/multiple-sentences-mod2.tex b/documentation/demonstrations/multiple-sentences-mod2.tex new file mode 100644 index 00000000..66bb088d --- /dev/null +++ b/documentation/demonstrations/multiple-sentences-mod2.tex @@ -0,0 +1,11 @@ +This is the first +sentence. +This is the; second, sentence. +This is the +third sentence. + +This is the fourth +sentence! +This is the fifth sentence? +This is the +sixth sentence. diff --git a/documentation/demonstrations/multiple-sentences-mod3.tex b/documentation/demonstrations/multiple-sentences-mod3.tex new file mode 100644 index 00000000..5cb45b9a --- /dev/null +++ b/documentation/demonstrations/multiple-sentences-mod3.tex @@ -0,0 +1,8 @@ +This is the first sentence. +This is the; second, sentence. +This is the third sentence. + +This is the fourth +sentence! +This is the fifth sentence? +This is the sixth sentence. diff --git a/documentation/demonstrations/multiple-sentences-mod4.tex b/documentation/demonstrations/multiple-sentences-mod4.tex new file mode 100644 index 00000000..de40da97 --- /dev/null +++ b/documentation/demonstrations/multiple-sentences-mod4.tex @@ -0,0 +1,8 @@ +This is the first sentence. +This is the; +second, sentence. +This is the third sentence. + +This is the fourth sentence! +This is the fifth sentence? +This is the sixth sentence. diff --git a/documentation/demonstrations/multiple-sentences-mod5.tex b/documentation/demonstrations/multiple-sentences-mod5.tex new file mode 100644 index 00000000..f325e171 --- /dev/null +++ b/documentation/demonstrations/multiple-sentences-mod5.tex @@ -0,0 +1,9 @@ +This is the first sentence. +This is the; +second, +sentence. +This is the third sentence. + +This is the fourth sentence! +This is the fifth sentence? +This is the sixth sentence. diff --git a/documentation/demonstrations/multiple-sentences.tex b/documentation/demonstrations/multiple-sentences.tex new file mode 100644 index 00000000..44bfda15 --- /dev/null +++ b/documentation/demonstrations/multiple-sentences.tex @@ -0,0 +1,7 @@ +This is the first +sentence. This is the; second, sentence. This is the +third sentence. + +This is the fourth +sentence! This is the fifth sentence? This is the +sixth sentence. diff --git a/documentation/demonstrations/multiple-sentences1-mod1.tex b/documentation/demonstrations/multiple-sentences1-mod1.tex new file mode 100644 index 00000000..10ab12a3 --- /dev/null +++ b/documentation/demonstrations/multiple-sentences1-mod1.tex @@ -0,0 +1,4 @@ +(Some sentences stand alone in brackets.) This is the first +sentence. +This is the; second, sentence. +This is the third sentence. diff --git a/documentation/demonstrations/multiple-sentences1-mod2.tex b/documentation/demonstrations/multiple-sentences1-mod2.tex new file mode 100644 index 00000000..c0b314c1 --- /dev/null +++ b/documentation/demonstrations/multiple-sentences1-mod2.tex @@ -0,0 +1,4 @@ +(Some sentences stand alone in brackets.) +This is the first sentence. +This is the; second, sentence. +This is the third sentence. diff --git a/documentation/demonstrations/multiple-sentences1.tex b/documentation/demonstrations/multiple-sentences1.tex new file mode 100644 index 00000000..ff98ced5 --- /dev/null +++ b/documentation/demonstrations/multiple-sentences1.tex @@ -0,0 +1,3 @@ +(Some sentences stand alone in brackets.) This is the first +sentence. This is the; second, sentence. This is the +third sentence. diff --git a/documentation/demonstrations/multiple-sentences2-mod1.tex b/documentation/demonstrations/multiple-sentences2-mod1.tex new file mode 100644 index 00000000..2e42f393 --- /dev/null +++ b/documentation/demonstrations/multiple-sentences2-mod1.tex @@ -0,0 +1,6 @@ +This is the first sentence. + +$a$ can +represent a +number. 7 is +at the beginning of this sentence. diff --git a/documentation/demonstrations/multiple-sentences2-mod2.tex b/documentation/demonstrations/multiple-sentences2-mod2.tex new file mode 100644 index 00000000..303c9f3d --- /dev/null +++ b/documentation/demonstrations/multiple-sentences2-mod2.tex @@ -0,0 +1,4 @@ +This is the first sentence. + +$a$ can represent a number. +7 is at the beginning of this sentence. diff --git a/documentation/demonstrations/multiple-sentences2.tex b/documentation/demonstrations/multiple-sentences2.tex new file mode 100644 index 00000000..638074fa --- /dev/null +++ b/documentation/demonstrations/multiple-sentences2.tex @@ -0,0 +1,7 @@ +This is the first +sentence. + +$a$ can +represent a +number. 7 is +at the beginning of this sentence. diff --git a/documentation/demonstrations/multiple-sentences3-mod1.tex b/documentation/demonstrations/multiple-sentences3-mod1.tex new file mode 100644 index 00000000..82f27579 --- /dev/null +++ b/documentation/demonstrations/multiple-sentences3-mod1.tex @@ -0,0 +1,7 @@ +The first sentence continues after the verbatim \begin{verbatim} + there are sentences within this. These + will not be operated + upon by latexindent.pl. +\end{verbatim} and finishes here. +Second sentence contains trailing comments, which are ignored. +% a commented full stop. diff --git a/documentation/demonstrations/multiple-sentences3.tex b/documentation/demonstrations/multiple-sentences3.tex new file mode 100644 index 00000000..5cae0fc7 --- /dev/null +++ b/documentation/demonstrations/multiple-sentences3.tex @@ -0,0 +1,9 @@ +The first sentence continues after the verbatim +\begin{verbatim} + there are sentences within this. These + will not be operated + upon by latexindent.pl. +\end{verbatim} +and finishes here. Second sentence % a commented full stop. +contains trailing comments, +which are ignored. diff --git a/documentation/demonstrations/multiple-sentences4-mod1.tex b/documentation/demonstrations/multiple-sentences4-mod1.tex new file mode 100644 index 00000000..86a767a9 --- /dev/null +++ b/documentation/demonstrations/multiple-sentences4-mod1.tex @@ -0,0 +1 @@ +This sentence \begin{itemize} \item continues \end{itemize} across itemize and finishes here. diff --git a/documentation/demonstrations/multiple-sentences4-mod2.tex b/documentation/demonstrations/multiple-sentences4-mod2.tex new file mode 100644 index 00000000..c63d118d --- /dev/null +++ b/documentation/demonstrations/multiple-sentences4-mod2.tex @@ -0,0 +1,6 @@ +This sentence +\begin{itemize} + \item continues +\end{itemize} +across itemize +and finishes here. diff --git a/documentation/demonstrations/multiple-sentences4-mod3.tex b/documentation/demonstrations/multiple-sentences4-mod3.tex new file mode 100644 index 00000000..2b48dcfe --- /dev/null +++ b/documentation/demonstrations/multiple-sentences4-mod3.tex @@ -0,0 +1,5 @@ +This sentence +\begin{itemize} + \item continues +\end{itemize} +across itemize and finishes here. diff --git a/documentation/demonstrations/multiple-sentences4.tex b/documentation/demonstrations/multiple-sentences4.tex new file mode 100644 index 00000000..1822f381 --- /dev/null +++ b/documentation/demonstrations/multiple-sentences4.tex @@ -0,0 +1,6 @@ +This sentence +\begin{itemize} + \item continues +\end{itemize} +across itemize +and finishes here. diff --git a/documentation/demonstrations/sentences-begin1.yaml b/documentation/demonstrations/sentences-begin1.yaml new file mode 100644 index 00000000..f2458e01 --- /dev/null +++ b/documentation/demonstrations/sentences-begin1.yaml @@ -0,0 +1,5 @@ +modifyLineBreaks: + oneSentencePerLine: + manipulateSentences: 1 + sentencesBeginWith: + other: "\$|[0-9]" diff --git a/documentation/demonstrations/sentences-end1.yaml b/documentation/demonstrations/sentences-end1.yaml new file mode 100644 index 00000000..b84ce620 --- /dev/null +++ b/documentation/demonstrations/sentences-end1.yaml @@ -0,0 +1,5 @@ +modifyLineBreaks: + oneSentencePerLine: + manipulateSentences: 1 + sentencesEndWith: + other: "\:|\;|\," diff --git a/documentation/demonstrations/sentences-end2.yaml b/documentation/demonstrations/sentences-end2.yaml new file mode 100644 index 00000000..6fd6367f --- /dev/null +++ b/documentation/demonstrations/sentences-end2.yaml @@ -0,0 +1,7 @@ +modifyLineBreaks: + oneSentencePerLine: + manipulateSentences: 1 + sentencesEndWith: + other: "\:|\;|\," + sentencesBeginWith: + a-z: 1 diff --git a/documentation/demonstrations/sentences-follow1.yaml b/documentation/demonstrations/sentences-follow1.yaml new file mode 100644 index 00000000..9d89f8ac --- /dev/null +++ b/documentation/demonstrations/sentences-follow1.yaml @@ -0,0 +1,5 @@ +modifyLineBreaks: + oneSentencePerLine: + manipulateSentences: 1 + sentencesFollow: + blankLine: 0 diff --git a/documentation/demonstrations/sentences-follow2.yaml b/documentation/demonstrations/sentences-follow2.yaml new file mode 100644 index 00000000..b4c6303d --- /dev/null +++ b/documentation/demonstrations/sentences-follow2.yaml @@ -0,0 +1,5 @@ +modifyLineBreaks: + oneSentencePerLine: + manipulateSentences: 1 + sentencesFollow: + other: "\)" diff --git a/documentation/demonstrations/simple.tex b/documentation/demonstrations/simple.tex new file mode 100644 index 00000000..95b7172d --- /dev/null +++ b/documentation/demonstrations/simple.tex @@ -0,0 +1,3 @@ +\begin{myenv} + body of myenv +\end{myenv} diff --git a/documentation/demonstrations/tabular.yaml b/documentation/demonstrations/tabular.yaml index 0212027b..5a47f8e4 100644 --- a/documentation/demonstrations/tabular.yaml +++ b/documentation/demonstrations/tabular.yaml @@ -5,6 +5,8 @@ lookForAlignDelims: spacesBeforeDoubleBackSlash: 0 multiColumnGrouping: 0 alignRowsWithoutMaxDelims: 1 + spacesBeforeAmpersand: 1 + spacesAfterAmpersand: 1 tabularx: delims: 1 longtable: 1 diff --git a/documentation/demonstrations/tabular1.yaml b/documentation/demonstrations/tabular1.yaml index e0233704..9222b437 100644 --- a/documentation/demonstrations/tabular1.yaml +++ b/documentation/demonstrations/tabular1.yaml @@ -1,8 +1,4 @@ lookForAlignDelims: tabular: - delims: 1 alignDoubleBackSlash: 0 spacesBeforeDoubleBackSlash: 3 - tabularx: - delims: 1 - longtable: 1 diff --git a/documentation/demonstrations/tabular2-mc.tex b/documentation/demonstrations/tabular2-mod2.tex similarity index 100% rename from documentation/demonstrations/tabular2-mc.tex rename to documentation/demonstrations/tabular2-mod2.tex diff --git a/documentation/demonstrations/tabular2-no-max.tex b/documentation/demonstrations/tabular2-mod3.tex similarity index 100% rename from documentation/demonstrations/tabular2-no-max.tex rename to documentation/demonstrations/tabular2-mod3.tex diff --git a/documentation/demonstrations/tabular2-mod4.tex b/documentation/demonstrations/tabular2-mod4.tex new file mode 100644 index 00000000..bc91f4ff --- /dev/null +++ b/documentation/demonstrations/tabular2-mod4.tex @@ -0,0 +1,8 @@ +\begin{tabular}{cccc} + A & B & C & D \\ + AAA & BBB & CCC & DDD \\ + \multicolumn{2}{c}{first heading} & \multicolumn{2}{c}{second heading} \\ + one & two & three & four \\ + five & & six & \\ + seven & \\ +\end{tabular} diff --git a/documentation/demonstrations/tabular2-mod5.tex b/documentation/demonstrations/tabular2-mod5.tex new file mode 100644 index 00000000..911ade57 --- /dev/null +++ b/documentation/demonstrations/tabular2-mod5.tex @@ -0,0 +1,8 @@ +\begin{tabular}{cccc} + A & B & C & D \\ + AAA & BBB & CCC & DDD \\ + \multicolumn{2}{c}{first heading} & \multicolumn{2}{c}{second heading} \\ + one & two & three & four \\ + five & & six & \\ + seven & \\ +\end{tabular} diff --git a/documentation/demonstrations/tabular2-mod6.tex b/documentation/demonstrations/tabular2-mod6.tex new file mode 100644 index 00000000..2a7786c9 --- /dev/null +++ b/documentation/demonstrations/tabular2-mod6.tex @@ -0,0 +1,8 @@ +\begin{tabular}{cccc} + A & B & C & D \\ + AAA & BBB & CCC & DDD \\ + \multicolumn{2}{c}{first heading} & \multicolumn{2}{c}{second heading} \\ + one & two & three & four \\ + five & & six & \\ + seven & \\ +\end{tabular} diff --git a/documentation/demonstrations/tabular2-mod7.tex b/documentation/demonstrations/tabular2-mod7.tex new file mode 100644 index 00000000..1c9a517a --- /dev/null +++ b/documentation/demonstrations/tabular2-mod7.tex @@ -0,0 +1,8 @@ +\begin{tabular}{cccc} + A & B & C & D \\ + AAA & BBB & CCC & DDD \\ + \multicolumn{2}{c}{first heading} & \multicolumn{2}{c}{second heading}\\ + one & two & three & four \\ + five & & six & \\ + seven & \\ +\end{tabular} diff --git a/documentation/demonstrations/tabular2-mod8.tex b/documentation/demonstrations/tabular2-mod8.tex new file mode 100644 index 00000000..1f7b684b --- /dev/null +++ b/documentation/demonstrations/tabular2-mod8.tex @@ -0,0 +1,8 @@ +\begin{tabular}{cccc} + A & B & C & D \\ + AAA & BBB & CCC & DDD \\ + \multicolumn{2}{c}{first heading} & \multicolumn{2}{c}{second heading} \\ + one & two & three & four \\ + five & & six & \\ + seven & \\ +\end{tabular} diff --git a/documentation/demonstrations/tabular4.yaml b/documentation/demonstrations/tabular4.yaml new file mode 100644 index 00000000..68f99e57 --- /dev/null +++ b/documentation/demonstrations/tabular4.yaml @@ -0,0 +1,3 @@ +lookForAlignDelims: + tabular: + spacesBeforeAmpersand: 4 diff --git a/documentation/demonstrations/tabular5.yaml b/documentation/demonstrations/tabular5.yaml new file mode 100644 index 00000000..7762a552 --- /dev/null +++ b/documentation/demonstrations/tabular5.yaml @@ -0,0 +1,3 @@ +lookForAlignDelims: + tabular: + spacesAfterAmpersand: 4 diff --git a/documentation/demonstrations/tabular6.yaml b/documentation/demonstrations/tabular6.yaml new file mode 100644 index 00000000..1b3e9015 --- /dev/null +++ b/documentation/demonstrations/tabular6.yaml @@ -0,0 +1,3 @@ +lookForAlignDelims: + tabular: + alignDoubleBackSlash: 0 diff --git a/documentation/demonstrations/tabular7.yaml b/documentation/demonstrations/tabular7.yaml new file mode 100644 index 00000000..4c541209 --- /dev/null +++ b/documentation/demonstrations/tabular7.yaml @@ -0,0 +1,3 @@ +lookForAlignDelims: + tabular: + spacesBeforeDoubleBackSlash: 0 diff --git a/documentation/demonstrations/tabular8.yaml b/documentation/demonstrations/tabular8.yaml new file mode 100644 index 00000000..e57f0a3b --- /dev/null +++ b/documentation/demonstrations/tabular8.yaml @@ -0,0 +1,3 @@ +lookForAlignDelims: + tabular: + justification: "right" diff --git a/documentation/demonstrations/url-mod1.tex b/documentation/demonstrations/url-mod1.tex new file mode 100644 index 00000000..d247920a --- /dev/null +++ b/documentation/demonstrations/url-mod1.tex @@ -0,0 +1,2 @@ +This sentence, \url{tex.stackexchange.com/} finishes here. +Second sentence. diff --git a/documentation/demonstrations/url-mod2.tex b/documentation/demonstrations/url-mod2.tex new file mode 100644 index 00000000..c99b07bf --- /dev/null +++ b/documentation/demonstrations/url-mod2.tex @@ -0,0 +1,2 @@ +This sentence, \url{tex. + stackexchange.com/} finishes here.Second sentence. diff --git a/documentation/demonstrations/url.tex b/documentation/demonstrations/url.tex new file mode 100644 index 00000000..9b8811d0 --- /dev/null +++ b/documentation/demonstrations/url.tex @@ -0,0 +1 @@ +This sentence, \url{tex.stackexchange.com/} finishes here. Second sentence. diff --git a/documentation/latex-indent.bib b/documentation/latex-indent.bib index fd54091e..ef30cc65 100644 --- a/documentation/latex-indent.bib +++ b/documentation/latex-indent.bib @@ -33,3 +33,7 @@ @online{texttabs url="http://search.cpan.org/~muir/Text-Tabs+Wrap-2013.0523/lib.old/Text/Tabs.pm", urldate={2017-07-06}, } +@online{log4perl, + title="Log4perl Perl module", + url="http://search.cpan.org/~mschilli/Log-Log4perl-1.49/lib/Log/Log4perl.pm", + urldate={2017-09-24}} diff --git a/documentation/latex-indent.sh b/documentation/latex-indent.sh index 62cc124a..fb95da68 100755 --- a/documentation/latex-indent.sh +++ b/documentation/latex-indent.sh @@ -8,5 +8,7 @@ loopmax=1 [[ $silentMode == 0 ]] && set -x find . -maxdepth 1 -name "*.tex" -exec latexindent.pl -l -w -m -s {} \; +find . -maxdepth 1 -name "*.tex" -exec latexindent.pl -l=+oneSentencePerLine.yaml -o=+-mod1 -m -s {} \; +mv *mod1*.tex ../test-cases/documentation/ find . -maxdepth 1 -name "*.bib" -exec latexindent.pl -l -w -m -s {} \; git status diff --git a/documentation/latexindent.tex b/documentation/latexindent.tex index ae47b9fd..e3ca8eee 100644 --- a/documentation/latexindent.tex +++ b/documentation/latexindent.tex @@ -193,7 +193,7 @@ % \cmhlistingsfromfile % * no star: not new, star: new % [ listing/minted options ] -% * no star: uses listings library star: uses minted library +% * no star: uses minted library, star: uses listings library star: % {} % [] % {} @@ -207,7 +207,7 @@ \DeclareTCBInputListing[use counter=lstlisting]{\cmhlistingsfromfile}{s O{} s m O{} m m}{% cmhlistings, listing file={#4}, - IfBooleanTF={#3}{minted options={obeytabs=true,showtabs=true,tabsize=4,showspaces=false,#2}}{listing options={#2}}, + IfBooleanTF={#3}{listing options={style=tcblatex,showspaces=false,#2}}{minted options={obeytabs=true,showtabs=false,tabsize=4,showspaces=false,#2}}, title={\color{black}{\scshape Listing \thetcbcounter}: ~#6},label={#7}, #5, IfBooleanTF={#1}{new-to-this-version}{addtolol}, @@ -289,133 +289,157 @@ \lstdefinestyle{logFilePreferences}{ style=yaml-LST, - firstnumber=79,linerange={79-83}, + firstnumber=79,linerange={79-89}, numbers=left, } \lstdefinestyle{verbatimEnvironments}{ style=yaml-LST, - firstnumber=87,linerange={87-90}, + firstnumber=93,linerange={93-96}, numbers=left, } \lstdefinestyle{verbatimCommands}{ style=yaml-LST, - firstnumber=93,linerange={93-95}, + firstnumber=99,linerange={99-101}, numbers=left, } \lstdefinestyle{noIndentBlock}{ style=yaml-LST, - firstnumber=101,linerange={101-103}, + firstnumber=107,linerange={107-109}, numbers=left, } \lstdefinestyle{removeTrailingWhitespace}{ style=yaml-LST, - firstnumber=106,linerange={106-108}, + firstnumber=112,linerange={112-114}, numbers=left, } \lstdefinestyle{fileContentsEnvironments}{ style=yaml-LST, - firstnumber=112,linerange={112-114}, + firstnumber=118,linerange={118-120}, numbers=left, } \lstdefinestyle{lookForPreamble}{ style=yaml-LST, - firstnumber=120,linerange={120-124}, + firstnumber=126,linerange={126-130}, numbers=left, } \lstdefinestyle{indentAfterItems}{ style=yaml-LST, - firstnumber=174,linerange={174-178}, + firstnumber=183,linerange={183-187}, numbers=left, } \lstdefinestyle{itemNames}{ style=yaml-LST, - firstnumber=184,linerange={184-186}, + firstnumber=193,linerange={193-195}, numbers=left, } \lstdefinestyle{specialBeginEnd}{ style=yaml-LST, - firstnumber=190,linerange={190-203}, + firstnumber=199,linerange={199-212}, numbers=left, } \lstdefinestyle{indentAfterHeadings}{ style=yaml-LST, - firstnumber=213,linerange={213-222}, + firstnumber=222,linerange={222-231}, numbers=left, } \lstdefinestyle{noAdditionalIndentGlobalEnv}{ style=yaml-LST, - firstnumber=271,linerange={271-272}, + firstnumber=280,linerange={280-281}, numbers=left, } \lstdefinestyle{noAdditionalIndentGlobal}{ style=yaml-LST, - firstnumber=271,linerange={271-283}, + firstnumber=280,linerange={280-292}, numbers=left, } \lstdefinestyle{indentRulesGlobalEnv}{ style=yaml-LST, - firstnumber=287,linerange={287-288}, + firstnumber=296,linerange={296-297}, numbers=left, } \lstdefinestyle{indentRulesGlobal}{ style=yaml-LST, - firstnumber=287,linerange={287-299}, + firstnumber=296,linerange={296-308}, numbers=left, } \lstdefinestyle{commandCodeBlocks}{ style=yaml-LST, - firstnumber=302,linerange={302-312}, + firstnumber=311,linerange={311-321}, numbers=left, } \lstdefinestyle{modifylinebreaks}{ style=yaml-LST, - firstnumber=382,linerange={382-384}, + firstnumber=391,linerange={391-393}, numbers=left, } \lstdefinestyle{textWrapOptions}{ style=yaml-LST, - firstnumber=385,linerange={385-386}, + firstnumber=394,linerange={394-395}, numbers=left, } \lstdefinestyle{textWrapOptionsAll}{ style=yaml-LST, - firstnumber=385,linerange={385-387}, + firstnumber=394,linerange={394-396}, numbers=left, } \lstdefinestyle{removeParagraphLineBreaks}{ style=yaml-LST, - firstnumber=388,linerange={388-400}, + firstnumber=419,linerange={419-431}, numbers=left, } \lstdefinestyle{paragraphsStopAt}{ style=yaml-LST, - firstnumber=401,linerange={401-409}, + firstnumber=432,linerange={432-440}, + numbers=left, +} + +\lstdefinestyle{oneSentencePerLine}{ + style=yaml-LST, + firstnumber=397,linerange={397-418}, + numbers=left, +} + +\lstdefinestyle{sentencesFollow}{ + style=yaml-LST, + firstnumber=400,linerange={400-408}, + numbers=left, +} + +\lstdefinestyle{sentencesBeginWith}{ + style=yaml-LST, + firstnumber=409,linerange={409-412}, + numbers=left, +} + +\lstdefinestyle{sentencesEndWith}{ + style=yaml-LST, + firstnumber=413,linerange={413-418}, numbers=left, } \lstdefinestyle{modifylinebreaksEnv}{ style=yaml-LST, - firstnumber=410,linerange={410-419}, + firstnumber=441,linerange={441-450}, numbers=left, } @@ -619,19 +643,19 @@ % toc settings \titleclass{\cmhtitle}{straight}[\subsection] \titleformat{\cmhtitle}{}{}{}{} -\titlecontents*{cmhtitle}% <paragaph> -[3cm]% <left> -{\small\itshape}% <above-code> -{}% <numbered-entry-format>; you could also use {\thecontentslabel. } to show the numbers -{}% <numberless-entry-format> -{\ \thecontentspage}% <filler-page-format> -[,\ ]% <separator> -[]% <end> +\titlecontents{cmhtitle}% <paragaph> + [2cm]% <left> + {\small\itshape}% <above-code> + {}% <numbered-entry-format>; you could also use {\thecontentslabel. } to show the numbers + {}% <numberless-entry-format> + {\titlerule*[0.5em]{$\cdot$}\contentspage} \setcounter{secnumdepth}{5} \begin{document} \renewcommand*{\thefootnote}{\arabic{footnote}} \input{title.tex} +\tableofcontents +{\small\lstlistoflistings} \input{sec-introduction} \input{sec-demonstration} \input{sec-how-to-use} @@ -648,6 +672,7 @@ \stopcontents[noAdditionalIndent] \input{subsec-commands-and-their-options} \input{sec-the-m-switch} +\stopcontents[the-m-switch] \input{subsec-partnering-poly-switches} \input{subsec-conflicting-poly-switches} \input{sec-conclusions-know-limitations} @@ -707,3 +732,23 @@ Version 3.2.2 Users can specify removeTrailingWhitespace as a scalar, for example, removeTrailingWhitespace: 0 https://github.com/cmhughes/latexindent.pl/pull/72 + +Version 3.3 +- maximum indentation: https://github.com/cmhughes/latexindent.pl/issues/50 +- blank line poly-switch: https://github.com/cmhughes/latexindent.pl/issues/57 +- ifnextchar issue: https://github.com/cmhughes/latexindent.pl/issues/73 +- the -y/yaml switch: https://github.com/cmhughes/latexindent.pl/issues/79 +- absolute paths for the -l switch: https://github.com/cmhughes/latexindent.pl/issues/82 +bug fixes: +- an ifelsefi bug: https://github.com/cmhughes/latexindent.pl/issues/76 +- empty environment bug: https://github.com/cmhughes/latexindent.pl/issues/78 +- a command/special bug: https://github.com/cmhughes/latexindent.pl/issues/80 +https://github.com/cmhughes/latexindent.pl/releases/tag/V3.3 + +Version 3.4 +- enhancements to alignment at ampersand routine: https://github.com/cmhughes/latexindent.pl/issues/74 +- log4Perl module: https://github.com/cmhughes/latexindent.pl/issues/75 +- one sentence per line: https://github.com/cmhughes/latexindent.pl/issues/81 +- STDIN allowed: https://github.com/cmhughes/latexindent.pl/issues/88 +- textwrap bug fix: https://github.com/cmhughes/latexindent.pl/issues/90 +- polyswitch bug fix: https://github.com/cmhughes/latexindent.pl/issues/94 diff --git a/documentation/oneSentencePerLine.yaml b/documentation/oneSentencePerLine.yaml new file mode 100644 index 00000000..8c38f574 --- /dev/null +++ b/documentation/oneSentencePerLine.yaml @@ -0,0 +1,33 @@ +modifyLineBreaks: + commands: + announce: + CommandStartsOnOwnLine: 2 + section: + CommandStartsOnOwnLine: 1 + subsection: + CommandStartsOnOwnLine: 1 + mandatoryArguments: + section: + RCuBFinishesWithLineBreak: 1 + subsection: + RCuBFinishesWithLineBreak: 1 + minipage: + RCuBFinishesWithLineBreak: 1 + environments: + enumerate: + BeginStartsOnOwnLine: 1 + BodyStartsOnOwnLine: 1 + EndStartsOnOwnLine: 1 + minipage: + BeginStartsOnOwnLine: 1 + BodyStartsOnOwnLine: 1 + EndStartsOnOwnLine: 1 + items: + ItemStartsOnOwnLine: 1 + oneSentencePerLine: + manipulateSentences: 1 + sentencesBeginWith: + other: "\\\\texttt\{" + sentencesEndWith: + fullStop: 0 + other: "\.(?!(?:[a-z]|\*|[0-9]|\}))" diff --git a/documentation/readme.txt b/documentation/readme.txt index 563595d2..458dc52c 100644 --- a/documentation/readme.txt +++ b/documentation/readme.txt @@ -1,5 +1,5 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - latexindent.pl, version 3.3, 2017-08-21 + latexindent.pl, version 3.4, 2018-01-13 PERL script to indent code within environments, and align delimited environments in .tex files. diff --git a/documentation/sec-conclusions-know-limitations.tex b/documentation/sec-conclusions-know-limitations.tex index 1b97f411..897e519e 100644 --- a/documentation/sec-conclusions-know-limitations.tex +++ b/documentation/sec-conclusions-know-limitations.tex @@ -3,7 +3,23 @@ \section{Conclusions and known limitations}\label{sec:knownlimitations} There are a number of known limitations of the script, and almost certainly quite a few that are \emph{unknown}! - The main limitation is to do with efficiency, particularly when the \texttt{-m} + The main limitation is to do with the alignment routine discussed on \cpageref{yaml:lookforaligndelims}; for example, + consider the file given in \cref{lst:matrix2}. + + \cmhlistingsfromfile*{demonstrations/matrix2.tex}{\texttt{matrix2.tex}}{lst:matrix2} + + The default output is given in \cref{lst:matrix2-default}, and it is clear that the alignment routine + has not worked as hoped, but it is \emph{expected}. + \cmhlistingsfromfile*{demonstrations/matrix2-default.tex}{\texttt{matrix2.tex} default output}{lst:matrix2-default} + + The reason for the problem is that when \texttt{latexindent.pl} stores its code blocks (see \vref{tab:code-blocks}) + it uses replacement tokens. The alignment routine is using the \emph{length of the replacement token} in its measuring -- I hope + to be able to address this in the future. + + There are other limitations to do with the multicolumn alignment routine (see \vref{lst:tabular2-mod2}); in particular, + when working with codeblocks in which multicolumn commands overlap, the algorithm can fail. + + Another limitation is to do with efficiency, particularly when the \texttt{-m} switch is active, as this adds many checks and processes. The current implementation relies upon finding and storing \emph{every} code block (see the discussion on \cpageref{page:phases}); it is hoped that, in a future version, only \emph{nested} code blocks will need diff --git a/documentation/sec-default-user-local.tex b/documentation/sec-default-user-local.tex index e1a3f0d0..d5afdbe0 100644 --- a/documentation/sec-default-user-local.tex +++ b/documentation/sec-default-user-local.tex @@ -22,7 +22,7 @@ \section{defaultSettings.yaml}\label{sec:defuseloc} latexindent.pl myfile \end{commandshell} \begin{wrapfigure}[8]{r}[0pt]{6cm} - \cmhlistingsfromfile[style=fileExtensionPreference]{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{fileExtensionPreference}}{lst:fileExtensionPreference} + \cmhlistingsfromfile[style=fileExtensionPreference]*{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{fileExtensionPreference}}{lst:fileExtensionPreference} \end{wrapfigure} in which case the script will look for \texttt{myfile} with the extensions @@ -78,19 +78,31 @@ \section{defaultSettings.yaml}\label{sec:defuseloc} The default value of \texttt{cycleThroughBackUps} is \texttt{0}. \yamltitle{logFilePreferences}*{fields} - \begin{wrapfigure}[10]{r}[0pt]{9cm} - \cmhlistingsfromfile[style=logFilePreferences,]{../defaultSettings.yaml}[width=.85\linewidth,before=\centering,yaml-TCB]{\texttt{logFilePreferences}}{lst:logFilePreferences} - \end{wrapfigure} \texttt{latexindent.pl} writes information to \texttt{indent.log}, some of which can be customized by changing \texttt{logFilePreferences}; see \cref{lst:logFilePreferences}. If you load your own user settings (see \vref{sec:indentconfig}) then \texttt{latexindent.pl} will detail them in \texttt{indent.log}; you can choose not to have the details logged by switching \texttt{showEveryYamlRead} to \texttt{0}. Once all of your settings have been loaded, you can see the amalgamated settings in the log file by switching \texttt{showAmalgamatedSettings} - to \texttt{1}, if you wish. The log file will end with the characters + to \texttt{1}, if you wish. + + \cmhlistingsfromfile*[style=logFilePreferences,]*{../defaultSettings.yaml}[width=.9\linewidth,before=\centering,yaml-TCB]{\texttt{logFilePreferences}}{lst:logFilePreferences} + + When% + \announce*{2018-01-13}{showDecorationStartCodeBlockTrace feature for log file} either of the \texttt{trace} modes (see \cpageref{page:traceswitch}) + are active, you will receive detailed information in \texttt{indent.log}. You can specify character strings + to appear before and after the notification of a found code block using, respectively, \texttt{showDecorationStartCodeBlockTrace} + and \texttt{showDecorationFinishCodeBlockTrace}. A demonstration is given in \vref{app:logfile-demo}. + + The log file will end with the characters given in \texttt{endLogFileWith}, and will report the \texttt{GitHub} address of \texttt{latexindent.pl} to the log file if \texttt{showGitHubInfoFooter} is set to \texttt{1}. + \texttt{latexindent.pl}% + \announce*{2018-01-13}{log file pattern layout for log file} uses the \texttt{log4perl} module \cite{log4perl} + to handle the creation of the logfile. You can specify the layout of the information given in the logfile + using any of the \texttt{Log Layouts} detailed at \cite{log4perl}. + \yamltitle{verbatimEnvironments}*{fields} A field that contains a list of environments @@ -98,11 +110,11 @@ \section{defaultSettings.yaml}\label{sec:defuseloc} on environments that you have specified in this field, see \cref{lst:verbatimEnvironments}. \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile[style=verbatimEnvironments]{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{verbatimEnvironments}}{lst:verbatimEnvironments} + \cmhlistingsfromfile[style=verbatimEnvironments]*{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{verbatimEnvironments}}{lst:verbatimEnvironments} \end{minipage}% \hfill \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile[style=verbatimCommands]{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{verbatimCommands}}{lst:verbatimCommands} + \cmhlistingsfromfile[style=verbatimCommands]*{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{verbatimCommands}}{lst:verbatimCommands} \end{minipage}% Note that if you put an environment in \texttt{verbatimEnvironments} @@ -117,7 +129,7 @@ \section{defaultSettings.yaml}\label{sec:defuseloc} \yamltitle{noIndentBlock}*{fields} \begin{wrapfigure}[8]{r}[0pt]{6cm} - \cmhlistingsfromfile[style=noIndentBlock]{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{noIndentBlock}}{lst:noIndentBlock} + \cmhlistingsfromfile[style=noIndentBlock]*{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{noIndentBlock}}{lst:noIndentBlock} \end{wrapfigure} If you have a block of code that you don't want \texttt{latexindent.pl} to touch (even if it is \emph{not} a verbatim-like environment) then you can wrap it in an environment from \texttt{noIndentBlock}; @@ -142,7 +154,7 @@ \section{defaultSettings.yaml}\label{sec:defuseloc} \yamltitle{removeTrailingWhitespace}*{fields}\label{yaml:removeTrailingWhitespace} \begin{wrapfigure}[10]{r}[0pt]{7cm} - \cmhlistingsfromfile[style=removeTrailingWhitespace]{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{removeTrailingWhitespace}{lst:removeTrailingWhitespace} + \cmhlistingsfromfile[style=removeTrailingWhitespace]*{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{removeTrailingWhitespace}{lst:removeTrailingWhitespace} \vspace{.1cm} \begin{yaml}[numbers=none]{removeTrailingWhitespace (alt)}[width=.8\linewidth,before=\centering]{lst:removeTrailingWhitespace-alt} @@ -161,7 +173,7 @@ \section{defaultSettings.yaml}\label{sec:defuseloc} \yamltitle{fileContentsEnvironments}*{field} \begin{wrapfigure}[6]{r}[0pt]{6cm} - \cmhlistingsfromfile[style=fileContentsEnvironments]{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{fileContentsEnvironments}}{lst:fileContentsEnvironments} + \cmhlistingsfromfile[style=fileContentsEnvironments]*{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{fileContentsEnvironments}}{lst:fileContentsEnvironments} \end{wrapfigure} Before \texttt{latexindent.pl} determines the difference between preamble (if any) and the main document, it first searches for any of the environments specified in \texttt{fileContentsEnvironments}, see @@ -179,7 +191,7 @@ \section{defaultSettings.yaml}\label{sec:defuseloc} \yamltitle{lookForPreamble}*{fields} \begin{wrapfigure}[8]{r}[0pt]{5cm} - \cmhlistingsfromfile[style=lookForPreamble]{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{lookForPreamble}{lst:lookForPreamble} + \cmhlistingsfromfile[style=lookForPreamble]*{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{lookForPreamble}{lst:lookForPreamble} \end{wrapfigure} Not all files contain preamble; for example, \texttt{sty}, \texttt{cls} and \texttt{bib} files typically do \emph{not}. Referencing \cref{lst:lookForPreamble}, if you set, for example, \texttt{.tex} to \texttt{0}, then regardless of the setting of the value of \texttt{indentPreamble}, preamble @@ -205,7 +217,7 @@ \section{defaultSettings.yaml}\label{sec:defuseloc} If you're interested in experimenting with \texttt{latexindent.pl} then you can \emph{remove} all indentation by setting \texttt{defaultIndent: ""}. -\yamltitle{lookForAlignDelims}*{fields} +\yamltitle{lookForAlignDelims}*{fields}\label{yaml:lookforaligndelims} \begin{wrapfigure}[12]{r}[0pt]{5cm} \begin{yaml}[numbers=none]{\texttt{lookForAlignDelims} (basic)}[width=.8\linewidth,before=\centering]{lst:aligndelims:basic} lookForAlignDelims: @@ -232,101 +244,119 @@ \section{defaultSettings.yaml}\label{sec:defuseloc} instances of the environment, you could wrap them in something from \texttt{noIndentBlock} (see \vref{lst:noIndentBlock}). \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile[showspaces=false,showtabs=false]*{demonstrations/tabular1.tex}{\texttt{tabular1.tex}}{lst:tabularbefore:basic} + \cmhlistingsfromfile{demonstrations/tabular1.tex}{\texttt{tabular1.tex}}{lst:tabularbefore:basic} \end{minipage}% \hfill \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile[showspaces=false,showtabs=false]*{demonstrations/tabular1-default.tex}{\texttt{tabular1.tex} default output}{lst:tabularafter:basic} + \cmhlistingsfromfile{demonstrations/tabular1-default.tex}{\texttt{tabular1.tex} default output}{lst:tabularafter:basic} \end{minipage}% - If you wish to remove the alignment of the \lstinline!\\! within a delimiter-aligned block, then the + If, for example, you wish to remove the alignment of the \lstinline!\\! within a delimiter-aligned block, then the advanced form of \texttt{lookForAlignDelims} shown in \cref{lst:aligndelims:advanced} is for you. - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/tabular.yaml}[yaml-TCB]{\texttt{tabular.yaml}}{lst:aligndelims:advanced} + \cmhlistingsfromfile*[style=yaml-LST]*{demonstrations/tabular.yaml}[yaml-TCB]{\texttt{tabular.yaml}}{lst:aligndelims:advanced} Note that you can use a mixture of the basic and advanced form: in \cref{lst:aligndelims:advanced} \texttt{tabular} and \texttt{tabularx} are advanced and \texttt{longtable} is basic. When using the advanced form, each field should receive at least 1 sub-field, and \emph{can} (but does not have to) receive any of the following fields: \begin{itemize} - \item \texttt{delims}: switch equivalent to simply specifying, for example, \texttt{tabular: 1} in - the basic version shown in \cref{lst:aligndelims:basic} (default: 1); - \item \texttt{alignDoubleBackSlash}: switch to determine if \lstinline!\\! should be aligned (default: 1); - \item \texttt{spacesBeforeDoubleBackSlash}: optionally, specifies the number of spaces to be inserted - before (non-aligned) \lstinline!\\!. In order to use this field, \texttt{alignDoubleBackSlash} needs - to be set to 0 (default: 0). - \item \announce{2017-06-19}{multiColumnGrouping} \texttt{multiColumnGrouping}: details if \texttt{latexindent.pl} should group columns - underneath a \lstinline!\multicolumn! command (default: 0); - \item \announce{2017-06-19}{alignRowsWithoutMaxDelims} \texttt{alignRowsWithoutMaxDelims}: details if rows that do not contain the - maximum number of delimeters should be formatted so as to have the ampersands aligned (default: 1). + \item \texttt{delims}: binary switch (0 or 1) equivalent to simply specifying, for example, \texttt{tabular: 1} in + the basic version shown in \cref{lst:aligndelims:basic}. If \texttt{delims} is set to \texttt{0} then the align at ampersand routine + will not be called for this code block (default: 1); + \item \texttt{alignDoubleBackSlash}: binary switch (0 or 1) to determine if \lstinline!\\! should be aligned (default: 1); + \item \texttt{spacesBeforeDoubleBackSlash}: optionally,% + \announce*{2018-01-13}*{update to spacesBeforeDoubleBackSlash in ampersand alignment} specifies the number (integer $\geq$ 0) of spaces to be inserted + before \lstinline!\\! (default: 1). \footnote{Previously this only activated if \texttt{alignDoubleBackSlash} was set to \texttt{0}.} + \item \announce{2017-06-19}{multiColumnGrouping} \texttt{multiColumnGrouping}: binary switch (0 or 1) that details if \texttt{latexindent.pl} should group columns + above and below a \lstinline!\multicolumn! command (default: 0); + \item \announce{2017-06-19}{alignRowsWithoutMaxDelims} \texttt{alignRowsWithoutMaxDelims}: binary switch (0 or 1) that details if rows that do not contain the + maximum number of delimeters should be formatted so as to have the ampersands aligned (default: 1); + \item \announce*{2018-01-13}{spacesBeforeAmpersand in ampersand alignment}\texttt{spacesBeforeAmpersand}: optionally specifies the number (integer $\geq$ 0) of + spaces to be placed \emph{before} ampersands (default: 1); + \item \announce*{2018-01-13}{spacesAfterAmpersand in ampersand alignment}\texttt{spacesAfterAmpersand}: optionally specifies the number (integer $\geq$ 0) of + spaces to be placed \emph{After} ampersands (default: 1); + \item \announce*{2018-01-13}{justification of cells in ampersand alignment}\texttt{justification}: optionally specifies the justification of each cell as either \emph{left} + or \emph{right} (default: left). \end{itemize} - Assuming that you have the settings in \cref{lst:aligndelims:advanced} saved in \texttt{tabular.yaml}, and the code - from \cref{lst:tabularbefore:basic} in \texttt{tabular1.tex} and you run - \begin{commandshell} -latexindent.pl -l tabular.yaml tabular1.tex -\end{commandshell} - then you should receive the before-and-after results shown in - \cref{lst:tabularbefore:advanced,lst:tabularafter:advanced}; note that the ampersands have been aligned, but - the \lstinline!\\! have not (compare the alignment of \lstinline!\\! in \cref{lst:tabularafter:basic,lst:tabularafter:advanced}). + We will explore each of these features using the file \texttt{tabular2.tex} in \cref{lst:tabular2} (which contains a \lstinline!\multicolumn! command), + and the YAML files in \crefrange{lst:tabular2YAML}{lst:tabular8YAML}. + \cmhlistingsfromfile{demonstrations/tabular2.tex}{\texttt{tabular2.tex}}{lst:tabular2} \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile[showspaces=false,showtabs=false]*{demonstrations/tabular1.tex}{\texttt{tabular1.tex}}{lst:tabularbefore:advanced} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/tabular2.yaml}[yaml-TCB]{\texttt{tabular2.yaml}}{lst:tabular2YAML} \end{minipage}% \hfill - \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile[showspaces=false,showtabs=false]*{demonstrations/tabular1-advanced.tex}{\texttt{tabular1.tex} using \cref{lst:aligndelims:advanced}}{lst:tabularafter:advanced} + \begin{minipage}{.48\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/tabular3.yaml}[yaml-TCB]{\texttt{tabular3.yaml}}{lst:tabular3YAML} \end{minipage}% - Saving \cref{lst:aligndelims:advanced} into \texttt{tabular1.yaml} as in \cref{lst:tabular1YAML}, and running the command - \begin{commandshell} -latexindent.pl -l tabular1.yaml tabular1.tex -\end{commandshell} - gives \cref{lst:tabularafter:spacing}; note the spacing before the \lstinline!\\!. - \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile[showspaces=false,showtabs=false]*{demonstrations/tabular1-advanced-3spaces.tex}{\texttt{tabular1.tex} using \cref{lst:tabular1YAML}}{lst:tabularafter:spacing} + \cmhlistingsfromfile*[style=yaml-LST]*{demonstrations/tabular4.yaml}[yaml-TCB]{\texttt{tabular4.yaml}}{lst:tabular4YAML} \end{minipage}% \hfill - \begin{minipage}{.54\textwidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/tabular1.yaml}[yaml-TCB]{\texttt{tabular1.yaml}}{lst:tabular1YAML} + \begin{minipage}{.48\textwidth} + \cmhlistingsfromfile*[style=yaml-LST]*{demonstrations/tabular5.yaml}[yaml-TCB]{\texttt{tabular5.yaml}}{lst:tabular5YAML} \end{minipage}% - Now consider the file \texttt{tabular2.tex} in \cref{lst:tabular2}, which contains a \lstinline!\multicolumn! command, and - the YAML files in \cref{lst:tabular2YAML,lst:tabular3YAML}. - - \cmhlistingsfromfile[showspaces=false,showtabs=false]*{demonstrations/tabular2.tex}{\texttt{tabular2.tex}}{lst:tabular2} \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/tabular2.yaml}[yaml-TCB]{\texttt{tabular2.yaml}}{lst:tabular2YAML} + \cmhlistingsfromfile*[style=yaml-LST]*{demonstrations/tabular6.yaml}[yaml-TCB]{\texttt{tabular6.yaml}}{lst:tabular6YAML} \end{minipage}% \hfill - \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/tabular3.yaml}[yaml-TCB]{\texttt{tabular3.yaml}}{lst:tabular3YAML} + \begin{minipage}{.48\textwidth} + \cmhlistingsfromfile*[style=yaml-LST]*{demonstrations/tabular7.yaml}[yaml-TCB]{\texttt{tabular7.yaml}}{lst:tabular7YAML} + \end{minipage}% + + \begin{minipage}{.48\textwidth} + \cmhlistingsfromfile*[style=yaml-LST]*{demonstrations/tabular8.yaml}[yaml-TCB]{\texttt{tabular8.yaml}}{lst:tabular8YAML} \end{minipage}% On running the commands \begin{commandshell} latexindent.pl tabular2.tex -latexindent.pl -s tabular2.tex -l tabular2.yaml -latexindent.pl -s tabular2.tex -l tabular3.yaml +latexindent.pl tabular2.tex -l tabular2.yaml +latexindent.pl tabular2.tex -l tabular3.yaml +latexindent.pl tabular2.tex -l tabular2.yaml,tabular4.yaml +latexindent.pl tabular2.tex -l tabular2.yaml,tabular5.yaml +latexindent.pl tabular2.tex -l tabular2.yaml,tabular6.yaml +latexindent.pl tabular2.tex -l tabular2.yaml,tabular7.yaml +latexindent.pl tabular2.tex -l tabular2.yaml,tabular8.yaml \end{commandshell} - we obtain the respective outputs given in \cref{lst:tabular2-default,lst:tabular2-mc,lst:tabular2-no-max}. + we obtain the respective outputs given in \crefrange{lst:tabular2-default}{lst:tabular2-mod8}. \begin{widepage} - \cmhlistingsfromfile[showspaces=false,showtabs=false]*{demonstrations/tabular2-default.tex}{\texttt{tabular2-default.tex}}{lst:tabular2-default} - \cmhlistingsfromfile[showspaces=false,showtabs=false]*{demonstrations/tabular2-mc.tex}{\texttt{tabular2-mc.tex}}{lst:tabular2-mc} - \cmhlistingsfromfile[showspaces=false,showtabs=false]*{demonstrations/tabular2-no-max.tex}{\texttt{tabular2-no-max.tex}}{lst:tabular2-no-max} + \cmhlistingsfromfile*{demonstrations/tabular2-default.tex}{\texttt{tabular2.tex} default output}{lst:tabular2-default} + \cmhlistingsfromfile*{demonstrations/tabular2-mod2.tex}{\texttt{tabular2.tex} using \cref{lst:tabular2YAML}}{lst:tabular2-mod2} + \cmhlistingsfromfile*{demonstrations/tabular2-mod3.tex}{\texttt{tabular2.tex} using \cref{lst:tabular3YAML}}{lst:tabular2-mod3} + \cmhlistingsfromfile*{demonstrations/tabular2-mod4.tex}{\texttt{tabular2.tex} using \cref{lst:tabular2YAML,lst:tabular4YAML}}{lst:tabular2-mod4} + \cmhlistingsfromfile*{demonstrations/tabular2-mod5.tex}{\texttt{tabular2.tex} using \cref{lst:tabular2YAML,lst:tabular5YAML}}{lst:tabular2-mod5} + \cmhlistingsfromfile*{demonstrations/tabular2-mod6.tex}{\texttt{tabular2.tex} using \cref{lst:tabular2YAML,lst:tabular6YAML}}{lst:tabular2-mod6} + \cmhlistingsfromfile*{demonstrations/tabular2-mod7.tex}{\texttt{tabular2.tex} using \cref{lst:tabular2YAML,lst:tabular7YAML}}{lst:tabular2-mod7} + \cmhlistingsfromfile*{demonstrations/tabular2-mod8.tex}{\texttt{tabular2.tex} using \cref{lst:tabular2YAML,lst:tabular8YAML}}{lst:tabular2-mod8} \end{widepage} Notice in particular: \begin{itemize} - \item in both \cref{lst:tabular2-default,lst:tabular2-mc} all rows have been aligned at the ampersand, even + \item in both \cref{lst:tabular2-default,lst:tabular2-mod2} all rows have been aligned at the ampersand, even those that do not contain the maximum number of ampersands (3 ampersands, in this case); \item in \cref{lst:tabular2-default} the columns have been aligned at the ampersand; - \item in \cref{lst:tabular2-mc} the \lstinline!\multicolumn! command has grouped the $2$ columns beneath \emph{and} above it, + \item in \cref{lst:tabular2-mod2} the \lstinline!\multicolumn! command has grouped the $2$ columns beneath \emph{and} above it, because \texttt{multiColumnGrouping} is set to $1$ in \cref{lst:tabular2YAML}; - \item in \cref{lst:tabular2-no-max} rows~3 and~6 have \emph{not} been aligned at the ampersand, because + \item in \cref{lst:tabular2-mod3} rows~3 and~6 have \emph{not} been aligned at the ampersand, because \texttt{alignRowsWithoutMaxDelims} has been to set to $0$ in \cref{lst:tabular3YAML}; however, - the \lstinline!\\! \emph{have} still been aligned. + the \lstinline!\\! \emph{have} still been aligned; + \item in \cref{lst:tabular2-mod4} the columns beneath and above the \lstinline!\multicolumn! commands have been + grouped (because \texttt{multiColumnGrouping} is set to $1$), and there are at least $4$ spaces \emph{before} + each aligned ampersand because \texttt{spacesBeforeAmpersand} is set to $4$; + \item in \cref{lst:tabular2-mod5} the columns beneath and above the \lstinline!\multicolumn! commands have been + grouped (because \texttt{multiColumnGrouping} is set to $1$), and there are at least $4$ spaces \emph{after} + each aligned ampersand because \texttt{spacesAfterAmpersand} is set to $4$; + \item in \cref{lst:tabular2-mod6} the \lstinline!\\! have \emph{not} been aligned, because \texttt{alignDoubleBackSlash} + is set to \texttt{0}, otherwise the output is the same as \cref{lst:tabular2-mod2}; + \item in \cref{lst:tabular2-mod7} the \lstinline!\\! \emph{have} been aligned, and because \texttt{spacesBeforeDoubleBackSlash} + is set to \texttt{0}, there are no spaces ahead of them; the output is otherwise the same as \cref{lst:tabular2-mod2}. + \item in \cref{lst:tabular2-mod8} the cells have been \emph{right}-justified; note that cells above and below the \lstinline!\multicol! + statements have still been group correctly, because of the settings in \cref{lst:tabular2YAML}. \end{itemize} As of Version 3.0, the alignment routine works on mandatory and optional arguments within commands, and also within `special' code blocks @@ -340,11 +370,11 @@ \section{defaultSettings.yaml}\label{sec:defuseloc} shown in \cref{lst:matrixbefore,lst:matrixafter} are achievable by default. \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile[columns=fixed]{demonstrations/matrix1.tex}{\texttt{matrix1.tex}}{lst:matrixbefore} + \cmhlistingsfromfile{demonstrations/matrix1.tex}{\texttt{matrix1.tex}}{lst:matrixbefore} \end{minipage}% \hfill \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile[columns=fixed]{demonstrations/matrix1-default.tex}{\texttt{matrix1.tex} default output}{lst:matrixafter} + \cmhlistingsfromfile{demonstrations/matrix1-default.tex}{\texttt{matrix1.tex} default output}{lst:matrixafter} \end{minipage}% If you have blocks of code that you wish to align at the \& character that @@ -355,11 +385,11 @@ \section{defaultSettings.yaml}\label{sec:defuseloc} environment name that you have specified in \texttt{lookForAlignDelims}. \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile[columns=fixed]{demonstrations/align-block.tex}{\texttt{align-block.tex}}{lst:alignmentmarkup} + \cmhlistingsfromfile{demonstrations/align-block.tex}{\texttt{align-block.tex}}{lst:alignmentmarkup} \end{minipage}% \hfill \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile[columns=fixed]{demonstrations/align-block-default.tex}{\texttt{align-block.tex} default output}{lst:alignmentmarkup-default} + \cmhlistingsfromfile{demonstrations/align-block-default.tex}{\texttt{align-block.tex} default output}{lst:alignmentmarkup-default} \end{minipage}% With reference to \vref{tab:code-blocks} and the, yet undiscussed, fields of \texttt{noAdditionalIndent} and \texttt{indentRules} @@ -367,7 +397,7 @@ \section{defaultSettings.yaml}\label{sec:defuseloc} \yamltitle{indentAfterItems}*{fields} \begin{wrapfigure}[5]{r}[0pt]{7cm} - \cmhlistingsfromfile[style=indentAfterItems]{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{indentAfterItems}}{lst:indentafteritems} + \cmhlistingsfromfile[style=indentAfterItems]*{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{indentAfterItems}}{lst:indentafteritems} \end{wrapfigure} The environment names specified in \texttt{indentAfterItems} tell \texttt{latexindent.pl} to look for \lstinline!\item! commands; if these switches are set to \texttt{1} @@ -384,7 +414,7 @@ \section{defaultSettings.yaml}\label{sec:defuseloc} \yamltitle{itemNames}*{fields} \begin{wrapfigure}[5]{r}[0pt]{5cm} - \cmhlistingsfromfile[style=itemNames]{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{itemNames}}{lst:itemNames} + \cmhlistingsfromfile[style=itemNames]*{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{itemNames}}{lst:itemNames} \end{wrapfigure} If you have your own \texttt{item} commands (perhaps you prefer to use \texttt{myitem}, for example) @@ -396,11 +426,11 @@ \section{defaultSettings.yaml}\label{sec:defuseloc} \yamltitle{specialBeginEnd}*{fields}\label{yaml:specialBeginEnd} The fields specified% - \announce*{2017-08-21}*{specialBeginEnd} in \texttt{specialBeginEnd} are, in their default state, focused on math mode begin and end statements, but + \announce{2017-08-21}*{specialBeginEnd} in \texttt{specialBeginEnd} are, in their default state, focused on math mode begin and end statements, but there is no requirement for this to be the case; \cref{lst:specialBeginEnd} shows the default settings of \texttt{specialBeginEnd}. - \cmhlistingsfromfile*[style=specialBeginEnd]{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{specialBeginEnd}}{lst:specialBeginEnd} + \cmhlistingsfromfile[style=specialBeginEnd]*{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{specialBeginEnd}}{lst:specialBeginEnd} The field \texttt{displayMath} represents \lstinline!\[...\]!, \texttt{inlineMath} represents \lstinline!$...$! and \texttt{displayMathTex} represents \lstinline!$$...$$!. You can, of course, @@ -422,20 +452,20 @@ \section{defaultSettings.yaml}\label{sec:defuseloc} \texttt{lookForThis} to \texttt{0}. There are% - \announce*{2017-08-21}{specialBeforeCommand} examples in which it is advantageous to search for \texttt{specialBeginEnd} fields \emph{before} + \announce{2017-08-21}{specialBeforeCommand} examples in which it is advantageous to search for \texttt{specialBeginEnd} fields \emph{before} searching for commands, and the \texttt{specialBeforeCommand} switch controls this behaviour. For example, consider the file shown in \cref{lst:specialLRbefore}. - \cmhlistingsfromfile*{demonstrations/specialLR.tex}{\texttt{specialLR.tex}}{lst:specialLRbefore} + \cmhlistingsfromfile{demonstrations/specialLR.tex}{\texttt{specialLR.tex}}{lst:specialLRbefore} Now consider the YAML files shown in \cref{lst:specialsLeftRight-yaml,lst:specialBeforeCommand-yaml} \begin{minipage}{.49\linewidth} - \cmhlistingsfromfile*{demonstrations/specialsLeftRight.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{specialsLeftRight.yaml}}{lst:specialsLeftRight-yaml} + \cmhlistingsfromfile[]*{demonstrations/specialsLeftRight.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{specialsLeftRight.yaml}}{lst:specialsLeftRight-yaml} \end{minipage} \hfill \begin{minipage}{.49\linewidth} - \cmhlistingsfromfile*{demonstrations/specialBeforeCommand.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{specialBeforeCommand.yaml}}{lst:specialBeforeCommand-yaml} + \cmhlistingsfromfile[]*{demonstrations/specialBeforeCommand.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{specialBeforeCommand.yaml}}{lst:specialBeforeCommand-yaml} \end{minipage} Upon running the following commands @@ -448,11 +478,11 @@ \section{defaultSettings.yaml}\label{sec:defuseloc} we receive the respective outputs in \cref{lst:specialLR-comm-first-tex,lst:specialLR-special-first-tex}. \begin{minipage}{.49\linewidth} - \cmhlistingsfromfile*{demonstrations/specialLR-comm-first.tex}{\texttt{specialLR.tex} using \cref{lst:specialsLeftRight-yaml}}{lst:specialLR-comm-first-tex} + \cmhlistingsfromfile{demonstrations/specialLR-comm-first.tex}{\texttt{specialLR.tex} using \cref{lst:specialsLeftRight-yaml}}{lst:specialLR-comm-first-tex} \end{minipage} \hfill \begin{minipage}{.49\linewidth} - \cmhlistingsfromfile*{demonstrations/specialLR-special-first.tex}{\texttt{specialLR.tex} using \cref{lst:specialsLeftRight-yaml,lst:specialBeforeCommand-yaml}}{lst:specialLR-special-first-tex} + \cmhlistingsfromfile{demonstrations/specialLR-special-first.tex}{\texttt{specialLR.tex} using \cref{lst:specialsLeftRight-yaml,lst:specialBeforeCommand-yaml}}{lst:specialLR-special-first-tex} \end{minipage} Notice that in: @@ -464,7 +494,7 @@ \section{defaultSettings.yaml}\label{sec:defuseloc} \yamltitle{indentAfterHeadings}*{fields} \begin{wrapfigure}[17]{r}[0pt]{8cm} - \cmhlistingsfromfile[style=indentAfterHeadings]{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{indentAfterHeadings}}{lst:indentAfterHeadings} + \cmhlistingsfromfile[style=indentAfterHeadings]*{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{indentAfterHeadings}}{lst:indentAfterHeadings} \end{wrapfigure} This field enables the user to specify indentation rules that take effect after heading commands such as \lstinline!\part!, \lstinline!\chapter!, @@ -487,7 +517,7 @@ \section{defaultSettings.yaml}\label{sec:defuseloc} and that you have the text from \cref{lst:headings1} saved into \texttt{headings1.tex}. \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/headings1.yaml}[yaml-TCB]{\texttt{headings1.yaml}}{lst:headings1yaml} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/headings1.yaml}[yaml-TCB]{\texttt{headings1.yaml}}{lst:headings1yaml} \end{minipage}% \hfill \begin{minipage}{.45\textwidth} @@ -501,11 +531,11 @@ \section{defaultSettings.yaml}\label{sec:defuseloc} then you should receive the output given in \cref{lst:headings1-mod1}. \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile{demonstrations/headings1-mod1.tex}{\texttt{headings1.tex} using \cref{lst:headings1yaml}}{lst:headings1-mod1} + \cmhlistingsfromfile[showtabs=true]{demonstrations/headings1-mod1.tex}{\texttt{headings1.tex} using \cref{lst:headings1yaml}}{lst:headings1-mod1} \end{minipage}% \hfill \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile{demonstrations/headings1-mod2.tex}{\texttt{headings1.tex} second modification}{lst:headings1-mod2} + \cmhlistingsfromfile[showtabs=true]{demonstrations/headings1-mod2.tex}{\texttt{headings1.tex} second modification}{lst:headings1-mod2} \end{minipage} Now say that you modify the \texttt{YAML} from \cref{lst:headings1yaml} so that the \texttt{paragraph} \texttt{level} is \texttt{1}; after @@ -518,7 +548,7 @@ \section{defaultSettings.yaml}\label{sec:defuseloc} \yamltitle{maximumIndentation}*{horizontal space} You can control the maximum indentation given to your file by% - \announce*{2017-08-21}{maximumIndentation} + \announce{2017-08-21}{maximumIndentation} specifying the \texttt{maximumIndentation} field as horizontal space (but \emph{not} including tabs). This feature uses the \texttt{Text::Tabs} module \cite{texttabs}, and is \emph{off} by default. @@ -527,11 +557,11 @@ \section{defaultSettings.yaml}\label{sec:defuseloc} shown in \cref{lst:mult-nested-default}. \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile*{demonstrations/mult-nested.tex}{\texttt{mult-nested.tex}}{lst:mult-nested} + \cmhlistingsfromfile{demonstrations/mult-nested.tex}{\texttt{mult-nested.tex}}{lst:mult-nested} \end{minipage}% \hfill \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile*{demonstrations/mult-nested-default.tex}{\texttt{mult-nested.tex} default output}{lst:mult-nested-default} + \cmhlistingsfromfile[showtabs=true]{demonstrations/mult-nested-default.tex}{\texttt{mult-nested.tex} default output}{lst:mult-nested-default} \end{minipage} Now say that, for example, you have the \texttt{max-indentation1.yaml} from \cref{lst:max-indentation1yaml} and @@ -542,11 +572,11 @@ \section{defaultSettings.yaml}\label{sec:defuseloc} You should receive the output shown in \cref{lst:mult-nested-max-ind1}. \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile*[style=yaml-LST]{demonstrations/max-indentation1.yaml}[yaml-TCB]{\texttt{max-indentation1.yaml}}{lst:max-indentation1yaml} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/max-indentation1.yaml}[yaml-TCB]{\texttt{max-indentation1.yaml}}{lst:max-indentation1yaml} \end{minipage}% \hfill \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile*{demonstrations/mult-nested-max-ind1.tex}{\texttt{mult-nested.tex} using \cref{lst:max-indentation1yaml}}{lst:mult-nested-max-ind1} + \cmhlistingsfromfile[showspaces=true]{demonstrations/mult-nested-max-ind1.tex}{\texttt{mult-nested.tex} using \cref{lst:max-indentation1yaml}}{lst:mult-nested-max-ind1} \end{minipage} Comparing the output in \cref{lst:mult-nested-default,lst:mult-nested-max-ind1} we notice that the (default) tabs diff --git a/documentation/sec-demonstration.tex b/documentation/sec-demonstration.tex index 656712e3..71eb207c 100644 --- a/documentation/sec-demonstration.tex +++ b/documentation/sec-demonstration.tex @@ -1,3 +1,4 @@ +% arara: pdflatex: {shell: yes, files: [latexindent]} \section{Demonstration: before and after} Let's give a demonstration of some before and after code -- after all, you probably won't want to try the script if you don't much like the results. You might also diff --git a/documentation/sec-how-to-use.tex b/documentation/sec-how-to-use.tex index 81364b18..33ee0ef2 100644 --- a/documentation/sec-how-to-use.tex +++ b/documentation/sec-how-to-use.tex @@ -19,7 +19,9 @@ \section{How to use the script} \texttt{latexindent.pl} ships with \texttt{latexindent.exe} for Windows users, so that you can use the script with or without a Perl distribution. If you plan to use \texttt{latexindent.pl} (i.e, the original Perl script) then you will - need a few standard Perl modules -- see \vref{sec:requiredmodules} for details. + need a few standard Perl modules -- see \vref{sec:requiredmodules} for details; + \announce{new}{perl module installer helper script} in particular, note + that a module installer helper script is shipped with \texttt{latexindent.pl}. \subsection{From the command line}\label{sec:commandline} \texttt{latexindent.pl} has a number of different switches/flags/options, which @@ -31,13 +33,6 @@ \subsection{From the command line}\label{sec:commandline} but other additional information will be written depending on which of the following options are used. - \begin{commandshell} -latexindent.pl - \end{commandshell} - - This will output a welcome message to the terminal, including the version number - and available options. - \flagbox{-v, --version} \announce{2017-06-25}{version} \begin{commandshell} @@ -199,7 +194,7 @@ \subsection{From the command line}\label{sec:commandline} The \texttt{-l} flag can take an \emph{optional} parameter which details the name (or names separated by commas) of a YAML file(s) that resides in the same directory as \texttt{myfile.tex}; you can use this option if you would like to load a settings file in the current working directory that is \emph{not} called \texttt{localSettings.yaml}. - \announce*{2017-08-21}*{-l switch absolute paths} In fact, you can specify both \emph{relative} and \emph{absolute paths} for your YAML files; + \announce{2017-08-21}*{-l switch absolute paths} In fact, you can specify both \emph{relative} and \emph{absolute paths} for your YAML files; for example \begin{commandshell} latexindent.pl -l=../../myyaml.yaml myfile.tex @@ -247,7 +242,7 @@ \subsection{From the command line}\label{sec:commandline} latexindent.pl myfile.tex -y='modifyLineBreaks:environments:one:EndStartsOnOwnLine:3' -m \end{commandshell} \label{page:yamlswitch}You% - \announce*{2017-08-21}{the -y switch} can specify YAML settings from the command line using the \texttt{-y} or \texttt{--yaml} switch; + \announce{2017-08-21}{the -y switch} can specify YAML settings from the command line using the \texttt{-y} or \texttt{--yaml} switch; sample demonstrations are given above. Note, in particular, that multiple settings can be specified by separating them via commas. There is a further option to use a \texttt{;} to separate fields, which is demonstrated in \vref{sec:yamlswitch}. @@ -265,7 +260,7 @@ \subsection{From the command line}\label{sec:commandline} call the script with the \texttt{-d} switch; note that this will also tell the script to ignore \texttt{localSettings.yaml} even if it has been called with the \texttt{-l} switch; \texttt{latexindent.pl}% - \announce*{2017-08-21}*{updated -d switch} will also ignore any settings specified + \announce{2017-08-21}*{updated -d switch} will also ignore any settings specified from the \texttt{-y} switch. \flagbox{-c, --cruft=<directory>} @@ -278,7 +273,7 @@ \subsection{From the command line}\label{sec:commandline} to another directory. % this switch was made as a result of http://tex.stackexchange.com/questions/142652/output-latexindent-auxiliary-files-to-a-different-directory -\flagbox{-g, --logfile} +\flagbox{-g, --logfile=<name of log file>} \begin{commandshell} latexindent.pl -g=other.log myfile.tex latexindent.pl -g other.log myfile.tex @@ -289,6 +284,15 @@ \subsection{From the command line}\label{sec:commandline} By default, \texttt{latexindent.pl} reports information to \texttt{indent.log}, but if you wish to change the name of this file, simply call the script with your chosen name after the \texttt{-g} switch as demonstrated above. +\flagbox{-sl, --screenlog} + \begin{commandshell} +latexindent.pl -sl myfile.tex +latexindent.pl -screenlog myfile.tex + \end{commandshell} + Using this% + \announce*{2018-01-13}{screenlog switch created} option tells \texttt{latexindent.pl} to output the log file to the screen, as well + as to your chosen log file. + \flagbox{-m, --modifylinebreaks} \begin{commandshell} latexindent.pl -m myfile.tex @@ -306,6 +310,28 @@ \subsection{From the command line}\label{sec:commandline} and in which case, you can specify the order in which extensions are searched for; see \vref{lst:fileExtensionPreference} for full details. +\flagbox{STDIN} + \begin{commandshell} +cat myfile.tex | latexindent.pl + \end{commandshell} + \texttt{latexindent.pl} will% + \announce*{2018-01-13}{STDIN allowed} allow input from STDIN, which means that you can pipe output from + other commands directly into the script. For example assuming that you have content in \texttt{myfile.tex}, then the above + command will output the results of operating upon \texttt{myfile.tex} + + Similarly, if you% + \announce*{2018-01-13}*{no options/filename updated} simply type \texttt{latexindent.pl} + at the command line, then it will expect (STDIN) input from the command line. + \begin{commandshell} +latexindent.pl + \end{commandshell} + + Once you have finished typing your input, you can press + \begin{itemize} + \item \texttt{CTRL+D} on Linux + \item \texttt{CTRL+Z} followed by \texttt{ENTER} on Windows + \end{itemize} + to signify that your input has finished. \subsection{From \texttt{arara}}\label{sec:arara} Using \texttt{latexindent.pl} from the command line is fine for some folks, but diff --git a/documentation/sec-indent-config-and-settings.tex b/documentation/sec-indent-config-and-settings.tex index 988b3a68..d3f68e4f 100644 --- a/documentation/sec-indent-config-and-settings.tex +++ b/documentation/sec-indent-config-and-settings.tex @@ -116,7 +116,7 @@ \subsection{\texttt{localSettings.yaml}}\label{sec:localsettings} \subsection{The \texttt{-y|yaml} switch}\label{sec:yamlswitch} You% - \announce*{2017-08-21}{demonstration of the -y switch} may use the \texttt{-y} switch to load + \announce{2017-08-21}{demonstration of the -y switch} may use the \texttt{-y} switch to load your settings; for example, if you wished to specify the settings from \cref{lst:localSettings} using the \texttt{-y} switch, then you could use the following command: \begin{commandshell} @@ -143,10 +143,10 @@ \subsection{Settings load order}\label{sec:loadorder} \item \texttt{localSettings.yaml} but only if found in the same directory as \texttt{myfile.tex} and called with \texttt{-l} switch; this file can be renamed, provided that the call to \texttt{latexindent.pl} is adjusted accordingly (see \cref{sec:localsettings}). You may specify both relative and absolute% - \announce*{2017-08-21}*{-l absolute paths} paths to other + \announce{2017-08-21}*{-l absolute paths} paths to other YAML files using the \texttt{-l} switch, separating multiple files using commas; \item any settings% - \announce*{2017-08-21}{-y switch load order} specified in the \texttt{-y} switch. + \announce{2017-08-21}{-y switch load order} specified in the \texttt{-y} switch. \end{enumerate} A visual representation of this is given in \cref{fig:loadorder}. diff --git a/documentation/sec-introduction.tex b/documentation/sec-introduction.tex index 154ea633..0e2ba9aa 100644 --- a/documentation/sec-introduction.tex +++ b/documentation/sec-introduction.tex @@ -58,7 +58,7 @@ \subsection{About this documentation} The different listings are presented using different styles: \begin{minipage}{.4\textwidth} - \cmhlistingsfromfile*{demonstrations/demo-tex.tex}{\texttt{demo-tex.tex}}{lst:demo-tex} + \cmhlistingsfromfile{demonstrations/demo-tex.tex}{\texttt{demo-tex.tex}}{lst:demo-tex} \end{minipage}% \hfill \begin{minipage}{.4\textwidth} @@ -66,7 +66,7 @@ \subsection{About this documentation} \end{minipage}% \begin{minipage}{.4\textwidth} - \cmhlistingsfromfile*[style=fileExtensionPreference]{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{fileExtensionPreference}}{lst:fileExtensionPreference-demo} + \cmhlistingsfromfile[style=fileExtensionPreference]*{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{fileExtensionPreference}}{lst:fileExtensionPreference-demo} \end{minipage}% \hfill \begin{minipage}{.4\textwidth} @@ -76,7 +76,7 @@ \subsection{About this documentation} \end{minipage}% \begin{minipage}{.55\textwidth} - \cmhlistingsfromfile*[style=modifylinebreaks]{../defaultSettings.yaml}[MLB-TCB,width=.85\linewidth,before=\centering]{\texttt{modifyLineBreaks}}{lst:modifylinebreaks-demo} + \cmhlistingsfromfile[style=modifylinebreaks]*{../defaultSettings.yaml}[MLB-TCB,width=.85\linewidth,before=\centering]{\texttt{modifyLineBreaks}}{lst:modifylinebreaks-demo} \end{minipage}% \hfill \begin{minipage}{.4\textwidth} @@ -94,3 +94,21 @@ \subsection{About this documentation} not read this document before (and even if you have!), then you can ignore every occurrence of the \stardemo; they are simply there to highlight new and updated features. The new and updated features in this documentation (\gitRel) are on the following pages: \listOfNewFeatures + +\subsection{Quick start}\label{sec:quickstart} + If you'd like to get started with \texttt{latexindent.pl} then simply type + \begin{commandshell} +latexindent.pl myfile.tex + \end{commandshell} + from the command line. If you receive an error message such as that given in \cref{lst:poss-errors}, + then you need to install the missing perl modules. + \begin{cmhlistings}[style=tcblatex,language=Perl]{Possible error messages}{lst:poss-errors} +Can't locate File/HomeDir.pm in @INC (@INC contains: /Library/Perl/5.12/darwin-thread-multi-2level /Library/Perl/5.12 /Network/Library/Perl/5.12/darwin-thread-multi-2level /Network/Library/Perl/5.12 /Library/Perl/Updates/5.12.4/darwin-thread-multi-2level /Library/Perl/Updates/5.12.4 /System/Library/Perl/5.12/darwin-thread-multi-2level /System/Library/Perl/5.12 /System/Library/Perl/Extras/5.12/darwin-thread-multi-2level /System/Library/Perl/Extras/5.12 .) at helloworld.pl line 10. +BEGIN failed--compilation aborted at helloworld.pl line 10. +\end{cmhlistings} + \texttt{latexindent.pl} ships with a script to help with this process; if you run the following script, you should be prompted + to install the appropriate modules. + \begin{commandshell} +perl latexindent-module-installer.pl + \end{commandshell} + You might also like to see \href{https://stackoverflow.com/questions/19590042/error-cant-locate-file-homedir-pm-in-inc}{https://stackoverflow.com/questions/19590042/error-cant-locate-file-homedir-pm-in-inc}, for example, as well as \vref{sec:requiredmodules}. diff --git a/documentation/sec-the-m-switch.tex b/documentation/sec-the-m-switch.tex index 278c1163..8e7f1a24 100644 --- a/documentation/sec-the-m-switch.tex +++ b/documentation/sec-the-m-switch.tex @@ -7,9 +7,12 @@ \section{The \texttt{-m} (\texttt{modifylinebreaks}) switch}\label{sec:modifylin All features described in this section will only be relevant if the \texttt{-m} switch is used. + \startcontents[the-m-switch] + \printcontents[the-m-switch]{}{0}{} + \yamltitle{modifylinebreaks}*{fields} \begin{wrapfigure}[7]{r}[0pt]{8cm} - \cmhlistingsfromfile[style=modifylinebreaks]{../defaultSettings.yaml}[MLB-TCB,width=.85\linewidth,before=\centering]{\texttt{modifyLineBreaks}}{lst:modifylinebreaks} + \cmhlistingsfromfile[style=modifylinebreaks]*{../defaultSettings.yaml}[MLB-TCB,width=.85\linewidth,before=\centering]{\texttt{modifyLineBreaks}}{lst:modifylinebreaks} \end{wrapfigure} \makebox[0pt][r]{% \raisebox{-\totalheight}[0pt][0pt]{% @@ -65,7 +68,7 @@ \section{The \texttt{-m} (\texttt{modifylinebreaks}) switch}\label{sec:modifylin will \emph{not} wrap text; if you change it to a value of \texttt{2} or more, then text will be wrapped after the character in the specified column. - \cmhlistingsfromfile[style=textWrapOptions]{../defaultSettings.yaml}[MLB-TCB,width=.85\linewidth,before=\centering]{\texttt{textWrapOptions}}{lst:textWrapOptions} + \cmhlistingsfromfile[style=textWrapOptions]*{../defaultSettings.yaml}[MLB-TCB,width=.85\linewidth,before=\centering]{\texttt{textWrapOptions}}{lst:textWrapOptions} For example, consider the file give in \cref{lst:textwrap1}. @@ -115,7 +118,7 @@ \section{The \texttt{-m} (\texttt{modifylinebreaks}) switch}\label{sec:modifylin \cmhlistingsfromfile{demonstrations/textwrap3-mod1.tex}{\texttt{textwrap3-mod1.tex}}{lst:textwrap3-mod1} \begin{wrapfigure}[6]{r}[0pt]{8cm} - \cmhlistingsfromfile[style=textWrapOptionsAll]{../defaultSettings.yaml}[MLB-TCB,width=.85\linewidth,before=\centering]{\texttt{textWrapOptions}}{lst:textWrapOptionsAll} + \cmhlistingsfromfile[style=textWrapOptionsAll]*{../defaultSettings.yaml}[MLB-TCB,width=.85\linewidth,before=\centering]{\texttt{textWrapOptions}}{lst:textWrapOptionsAll} \end{wrapfigure} The text wrapping routine of \texttt{latexindent.pl} is performed by the \texttt{Text::Wrap} module, which provides a \texttt{separator} feature to separate lines with characters other than a new line (see \cite{textwrap}). By default, @@ -147,13 +150,278 @@ \section{The \texttt{-m} (\texttt{modifylinebreaks}) switch}\label{sec:modifylin will likely exceed any maximum value set in the \texttt{columns} field. \end{itemize} -\yamltitle{removeParagraphLineBreaks}*{fields} +\subsection{\texttt{oneSentencePerLine}: modifying line breaks for sentences}\label{sec:onesentenceperline} + You can instruct \texttt{latexindent.pl} to format% + \announce*{2018-01-13}{one sentence per line} your file so that it puts one sentence + per line. Thank you to \cite{mlep} for helping to shape and test this feature. The behaviour of this part of the script is controlled by the switches detailed in \cref{lst:oneSentencePerLine}, + all of which we discuss next. + + \cmhlistingsfromfile*[style=oneSentencePerLine]*{../defaultSettings.yaml}[MLB-TCB,width=.85\linewidth,before=\centering]{\texttt{oneSentencePerLine}}{lst:oneSentencePerLine} + +\yamltitle{manipulateSentences}{0|1} + This is a binary switch that details if \texttt{latexindent.pl} should perform the sentence manipulation routine; it + is \emph{off} (set to \texttt{0}) by default, and you will need to turn it on (by setting it to \texttt{1}) if you want the script + to modify line breaks surrounding and within sentences. + +\yamltitle{removeSentenceLineBreaks}{0|1} + When operating upon sentences \texttt{latexindent.pl} will, by default, remove internal linebreaks as \texttt{removeSentenceLineBreaks} + is set to \texttt{1}. Setting this switch to \texttt{0} instructs \texttt{latexindent.pl} not to do so. + + For example, consider \texttt{multiple-sentences.tex} shown in \cref{lst:multiple-sentences}. + + \cmhlistingsfromfile*{demonstrations/multiple-sentences.tex}{\texttt{multiple-sentences.tex}}{lst:multiple-sentences} + + If we use the YAML files in \cref{lst:manipulate-sentences-yaml,lst:keep-sen-line-breaks-yaml}, and run the commands + \begin{widepage} + \begin{commandshell} +latexindent.pl multiple-sentences -m -l=manipulate-sentences.yaml +latexindent.pl multiple-sentences -m -l=keep-sen-line-breaks.yaml + \end{commandshell} + \end{widepage} + then we obtain the respective output given in \cref{lst:multiple-sentences-mod1,lst:multiple-sentences-mod2}. + + \begin{minipage}{.5\linewidth} + \cmhlistingsfromfile*{demonstrations/multiple-sentences-mod1.tex}{\texttt{multiple-sentences.tex} using \cref{lst:manipulate-sentences-yaml}}{lst:multiple-sentences-mod1} + \end{minipage} + \hfill + \begin{minipage}{.5\linewidth} + \cmhlistingsfromfile*[style=yaml-LST]*{demonstrations/manipulate-sentences.yaml}[MLB-TCB]{\texttt{manipulate-sentences.yaml}}{lst:manipulate-sentences-yaml} + \end{minipage} + + \begin{minipage}{.5\linewidth} + \cmhlistingsfromfile*{demonstrations/multiple-sentences-mod2.tex}{\texttt{multiple-sentences.tex} using \cref{lst:keep-sen-line-breaks-yaml}}{lst:multiple-sentences-mod2} + \end{minipage} + \hfill + \begin{minipage}{.5\linewidth} + \cmhlistingsfromfile*[style=yaml-LST]*{demonstrations/keep-sen-line-breaks.yaml}[MLB-TCB]{\texttt{keep-sen-line-breaks.yaml}}{lst:keep-sen-line-breaks-yaml} + \end{minipage} + + Notice, in particular, that the `internal' sentence line breaks in \cref{lst:multiple-sentences} have + been removed in \cref{lst:multiple-sentences-mod1}, but have not been removed in \cref{lst:multiple-sentences-mod2}. + + The remainder of the settings displayed in \vref{lst:oneSentencePerLine} instruct \texttt{latexindent.pl} on how to define + a sentence. From the perpesctive of \texttt{latexindent.pl} a sentence must: + \begin{itemize} + \item \emph{follow} a certain character or set of characters (see \cref{lst:sentencesFollow}); by default, this is either \lstinline!\par!, a blank line, + a full stop/period (.), exclamation mark (!), question mark (?) right brace (\}) or a comment + on the previous line; + \item \emph{begin} with a character type (see \cref{lst:sentencesBeginWith}); by default, this is only capital letters; + \item \emph{end} with a character (see \cref{lst:sentencesEndWith}); by default, these are + full stop/period (.), exclamation mark (!) and question mark (?). + \end{itemize} + In each case, you can specify the \texttt{other} field to include any pattern that you would like; you can specify anything in + this field using the language of regular expressions. + + \begin{adjustwidth}{-3.5cm}{-2.5cm} + \begin{minipage}{.36\linewidth} + \cmhlistingsfromfile*[style=sentencesFollow]*{../defaultSettings.yaml}[MLB-TCB,width=.9\linewidth,before=\centering]{\texttt{sentencesFollow}}{lst:sentencesFollow} + \end{minipage} + \hfill + \begin{minipage}{.31\linewidth} + \cmhlistingsfromfile*[style=sentencesBeginWith]*{../defaultSettings.yaml}[MLB-TCB,width=.9\linewidth,before=\centering]{\texttt{sentencesBeginWith}}{lst:sentencesBeginWith} + \end{minipage} + \hfill + \begin{minipage}{.31\linewidth} + \cmhlistingsfromfile*[style=sentencesEndWith]*{../defaultSettings.yaml}[MLB-TCB,width=.9\linewidth,before=\centering]{\texttt{sentencesEndWith}}{lst:sentencesEndWith} + \end{minipage} + \end{adjustwidth} + +\subsubsection{\texttt{sentencesFollow}} + Let's explore a few of the switches in \texttt{sentencesFollow}; let's start with \vref{lst:multiple-sentences}, and use the YAML + settings given in \cref{lst:sentences-follow1-yaml}. Using the command + \begin{commandshell} +latexindent.pl multiple-sentences -m -l=sentences-follow1.yaml +\end{commandshell} + we obtain the output given in \cref{lst:multiple-sentences-mod3}. + + \begin{minipage}{.5\linewidth} + \cmhlistingsfromfile*{demonstrations/multiple-sentences-mod3.tex}{\texttt{multiple-sentences.tex} using \cref{lst:sentences-follow1-yaml}}{lst:multiple-sentences-mod3} + \end{minipage} + \hfill + \begin{minipage}{.5\linewidth} + \cmhlistingsfromfile*[style=yaml-LST]*{demonstrations/sentences-follow1.yaml}[MLB-TCB]{\texttt{sentences-follow1.yaml}}{lst:sentences-follow1-yaml} + \end{minipage} + + Notice that, because \texttt{blankLine} is set to \texttt{0}, \texttt{latexindent.pl} will not seek sentences following a blank line, + and so the fourth sentence has not been accounted for. + + We can explore the \texttt{other} field in \cref{lst:sentencesFollow} with the \texttt{.tex} file detailed in \cref{lst:multiple-sentences1}. + + \cmhlistingsfromfile*{demonstrations/multiple-sentences1.tex}{\texttt{multiple-sentences1.tex}}{lst:multiple-sentences1} + + Upon running the following commands + \begin{widepage} + \begin{commandshell} +latexindent.pl multiple-sentences1 -m -l=manipulate-sentences.yaml +latexindent.pl multiple-sentences1 -m -l=manipulate-sentences.yaml,sentences-follow2.yaml + \end{commandshell} + \end{widepage} + then we obtain the respective output given in \cref{lst:multiple-sentences1-mod1,lst:multiple-sentences1-mod2}. + \cmhlistingsfromfile*{demonstrations/multiple-sentences1-mod1.tex}{\texttt{multiple-sentences1.tex} using \vref{lst:manipulate-sentences-yaml}}{lst:multiple-sentences1-mod1} + + \begin{minipage}{.55\linewidth} + \cmhlistingsfromfile*{demonstrations/multiple-sentences1-mod2.tex}{\texttt{multiple-sentences1.tex} using \cref{lst:sentences-follow2-yaml}}{lst:multiple-sentences1-mod2} + \end{minipage} + \hfill + \begin{minipage}{.45\linewidth} + \cmhlistingsfromfile*[style=yaml-LST]*{demonstrations/sentences-follow2.yaml}[MLB-TCB]{\texttt{sentences-follow2.yaml}}{lst:sentences-follow2-yaml} + \end{minipage} + + Notice that in \cref{lst:multiple-sentences1-mod1} the first sentence after the \texttt{)} has not been accounted for, but that + following the inclusion of \cref{lst:sentences-follow2-yaml}, the output given in \cref{lst:multiple-sentences1-mod2} demonstrates that + the sentence \emph{has} been accounted for correctly. + +\subsubsection{\texttt{sentencesBeginWith}} + By default, \texttt{latexindent.pl} will only assume that sentences begin with the upper case letters \texttt{A-Z}; you can instruct the + script to define sentences to begin with lower case letters (see \cref{lst:sentencesBeginWith}), and we can use the \texttt{other} field + to define sentences to begin with other characters. + + \cmhlistingsfromfile*{demonstrations/multiple-sentences2.tex}{\texttt{multiple-sentences2.tex}}{lst:multiple-sentences2} + + Upon running the following commands + \begin{widepage} + \begin{commandshell} +latexindent.pl multiple-sentences2 -m -l=manipulate-sentences.yaml +latexindent.pl multiple-sentences2 -m -l=manipulate-sentences.yaml,sentences-begin1.yaml + \end{commandshell} + \end{widepage} + then we obtain the respective output given in \cref{lst:multiple-sentences2-mod1,lst:multiple-sentences2-mod2}. + \cmhlistingsfromfile*{demonstrations/multiple-sentences2-mod1.tex}{\texttt{multiple-sentences2.tex} using \vref{lst:manipulate-sentences-yaml}}{lst:multiple-sentences2-mod1} + + \begin{minipage}{.55\linewidth} + \cmhlistingsfromfile*{demonstrations/multiple-sentences2-mod2.tex}{\texttt{multiple-sentences2.tex} using \cref{lst:sentences-begin1-yaml}}{lst:multiple-sentences2-mod2} + \end{minipage} + \hfill + \begin{minipage}{.45\linewidth} + \cmhlistingsfromfile*[style=yaml-LST]*{demonstrations/sentences-begin1.yaml}[MLB-TCB]{\texttt{sentences-begin1.yaml}}{lst:sentences-begin1-yaml} + \end{minipage} + Notice that in \cref{lst:multiple-sentences2-mod1}, the first sentence has been accounted for but that the subsequent sentences + have not. In \cref{lst:multiple-sentences2-mod2}, all of the sentences have been accounted for, because the \texttt{other} field + in \cref{lst:sentences-begin1-yaml} has defined sentences to begin with either \lstinline!$! or any numeric digit, \texttt{0} to \texttt{9}. + +\subsubsection{\texttt{sentencesEndWith}} + Let's return to \vref{lst:multiple-sentences}; we have already seen the default way in which \texttt{latexindent.pl} will operate on the + sentences in this file in \vref{lst:multiple-sentences-mod1}. We can populate the \texttt{other} field with any character that we wish; + for example, using the YAML specified in \cref{lst:sentences-end1-yaml} and the command + \begin{commandshell} +latexindent.pl multiple-sentences -m -l=sentences-end1.yaml +latexindent.pl multiple-sentences -m -l=sentences-end2.yaml +\end{commandshell} + then we obtain the output in \cref{lst:multiple-sentences-mod4}. + + \begin{minipage}{.5\linewidth} + \cmhlistingsfromfile*{demonstrations/multiple-sentences-mod4.tex}{\texttt{multiple-sentences.tex} using \cref{lst:sentences-end1-yaml}}{lst:multiple-sentences-mod4} + \end{minipage} + \hfill + \begin{minipage}{.5\linewidth} + \cmhlistingsfromfile*[style=yaml-LST]*{demonstrations/sentences-end1.yaml}[MLB-TCB]{\texttt{sentences-end1.yaml}}{lst:sentences-end1-yaml} + \end{minipage} + + \begin{minipage}{.5\linewidth} + \cmhlistingsfromfile*{demonstrations/multiple-sentences-mod5.tex}{\texttt{multiple-sentences.tex} using \cref{lst:sentences-end2-yaml}}{lst:multiple-sentences-mod5} + \end{minipage} + \hfill + \begin{minipage}{.5\linewidth} + \cmhlistingsfromfile*[style=yaml-LST]*{demonstrations/sentences-end2.yaml}[MLB-TCB]{\texttt{sentences-end2.yaml}}{lst:sentences-end2-yaml} + \end{minipage} + + There is a subtle difference between the output in \cref{lst:multiple-sentences-mod4,lst:multiple-sentences-mod5}; in particular, + in \cref{lst:multiple-sentences-mod4} the word \texttt{sentence} has not been defined as a sentence, because we have not instructed + \texttt{latexindent.pl} to begin sentences with lower case letters. We have changed this by using the settings in \cref{lst:sentences-end2-yaml}, + and the associated output in \cref{lst:multiple-sentences-mod5} reflects this. + + Referencing \vref{lst:sentencesEndWith}, you'll notice that there is a field called \texttt{basicFullStop}, which + is set to \texttt{0}, and that the \texttt{betterFullStop} is set to \texttt{1} by default. + + Let's consider the file shown in \cref{lst:url}. + + \cmhlistingsfromfile*{demonstrations/url.tex}{\texttt{url.tex}}{lst:url} + + Upon running the following commands + \begin{commandshell} +latexindent.pl url -m -l=manipulate-sentences.yaml +\end{commandshell} + we obtain the output given in \cref{lst:url-mod1}. + + \cmhlistingsfromfile*{demonstrations/url-mod1.tex}{\texttt{url.tex} using \vref{lst:manipulate-sentences-yaml}}{lst:url-mod1} + + Notice that the full stop within the url has been interpreted correctly. This is because, within the \texttt{betterFullStop}, + full stops at the end of sentences have the following properties: + \begin{itemize} + \item they are ignored within \texttt{e.g.} and \texttt{i.e.}; + \item they can not be immediately followed by a lower case or upper case letter; + \item they can not be immediately followed by a hyphen, comma, or number. + \end{itemize} + If you find that the \texttt{betterFullStop} does not work for your purposes, then you can switch it off by setting + it to \texttt{0}, and you can experiment with the \texttt{other} field. + + The \texttt{basicFullStop} routine should probably be avoided in most situations, as it does not accomodate the specifications + above. For example, using the YAML in \cref{lst:alt-full-stop1-yaml} gives the output from the following command in \cref{lst:url-mod2}. + \begin{commandshell} +latexindent.pl url -m -l=alt-full-stop1.yaml +\end{commandshell} + + \begin{adjustwidth}{-3.5cm}{-1.5cm} + \begin{minipage}{.6\linewidth} + \cmhlistingsfromfile*{demonstrations/url-mod2.tex}{\texttt{url.tex} using \cref{lst:alt-full-stop1-yaml}}{lst:url-mod2} + \end{minipage} + \hfill + \begin{minipage}{.4\linewidth} + \cmhlistingsfromfile*[style=yaml-LST]*{demonstrations/alt-full-stop1.yaml}[MLB-TCB]{\texttt{alt-full-stop1.yaml}}{lst:alt-full-stop1-yaml} + \end{minipage} + \end{adjustwidth} + + Notice that the full stop within the URL has not been accomodated correctly because of the non-default settings in \cref{lst:alt-full-stop1-yaml}. + +\subsubsection{Features of the \texttt{oneSentencePerLine} routine} + The sentence manipulation routine takes place \emph{after} verbatim environments, preamble and trailing comments have + been accounted for; this means that any characters within these types of code blocks will not be part + of the sentence manipulation routine. + + For example, if we begin with the \texttt{.tex} file in \cref{lst:multiple-sentences3}, and run the command + \begin{commandshell} +latexindent.pl multiple-sentences3 -m -l=manipulate-sentences.yaml + \end{commandshell} + then we obtain the output in \cref{lst:multiple-sentences3-mod1}. + \cmhlistingsfromfile*{demonstrations/multiple-sentences3.tex}{\texttt{multiple-sentences3.tex}}{lst:multiple-sentences3} + \cmhlistingsfromfile*{demonstrations/multiple-sentences3-mod1.tex}{\texttt{multiple-sentences3.tex} using \vref{lst:manipulate-sentences-yaml}}{lst:multiple-sentences3-mod1} + + Furthermore, if sentences run across environments then, by default, the line breaks internal to the sentence will be removed. + For example, if we use the \texttt{.tex} file in \cref{lst:multiple-sentences4} and run the commands + \begin{commandshell} +latexindent.pl multiple-sentences4 -m -l=manipulate-sentences.yaml +latexindent.pl multiple-sentences4 -m -l=keep-sen-line-breaks.yaml + \end{commandshell} + then we obtain the output in \cref{lst:multiple-sentences4-mod1,lst:multiple-sentences4-mod2}. + \cmhlistingsfromfile*{demonstrations/multiple-sentences4.tex}{\texttt{multiple-sentences4.tex}}{lst:multiple-sentences4} + \begin{widepage} + \cmhlistingsfromfile*{demonstrations/multiple-sentences4-mod1.tex}{\texttt{multiple-sentences4.tex} using \vref{lst:manipulate-sentences-yaml}}{lst:multiple-sentences4-mod1} + \end{widepage} + \cmhlistingsfromfile*{demonstrations/multiple-sentences4-mod2.tex}{\texttt{multiple-sentences4.tex} using \vref{lst:keep-sen-line-breaks-yaml}}{lst:multiple-sentences4-mod2} + Once you've read \cref{sec:poly-switches}, you will know that you can accomodate the removal of internal sentence line breaks + by using the YAML in \cref{lst:item-rules2-yaml} and the command + \begin{commandshell} +latexindent.pl multiple-sentences4 -m -l=item-rules2.yaml + \end{commandshell} + the output of which is shown in \cref{lst:multiple-sentences4-mod3}. + + \begin{minipage}{.5\linewidth} + \cmhlistingsfromfile*{demonstrations/multiple-sentences4-mod3.tex}{\texttt{multiple-sentences4.tex} using \cref{lst:item-rules2-yaml}}{lst:multiple-sentences4-mod3} + \end{minipage} + \hfill + \begin{minipage}{.5\linewidth} + \cmhlistingsfromfile*[style=yaml-LST]*{demonstrations/item-rules2.yaml}[MLB-TCB]{\texttt{item-rules2.yaml}}{lst:item-rules2-yaml} + \end{minipage} + +\subsection{\texttt{removeParagraphLineBreaks}: modifying line breaks for paragraphs} When the \texttt{-m} switch is active \texttt{latexindent.pl} has the ability to remove line breaks \announce{2017-05-27}{removeParagraphLineBreaks} from within paragraphs; the behaviour is controlled by the \texttt{removeParagraphLineBreaks} field, detailed in \cref{lst:removeParagraphLineBreaks}. Thank you to \cite{jowens} for shaping and assisting with the testing of this feature. +\yamltitle{removeParagraphLineBreaks}*{fields} + This feature is considered complimentary to the \texttt{oneSentencePerLine} feature described in \vref{sec:onesentenceperline}. - \cmhlistingsfromfile[style=removeParagraphLineBreaks]{../defaultSettings.yaml}[MLB-TCB,width=.85\linewidth,before=\centering]{\texttt{removeParagraphLineBreaks}}{lst:removeParagraphLineBreaks} + \cmhlistingsfromfile[style=removeParagraphLineBreaks]*{../defaultSettings.yaml}[MLB-TCB,width=.85\linewidth,before=\centering]{\texttt{removeParagraphLineBreaks}}{lst:removeParagraphLineBreaks} This routine can be turned on \emph{globally} for \emph{every} code block type known to \texttt{latexindent.pl} (see \vref{tab:code-blocks}) by using the \texttt{all} switch; by default, this switch is \emph{off}. Assuming @@ -172,7 +440,7 @@ \section{The \texttt{-m} (\texttt{modifylinebreaks}) switch}\label{sec:modifylin \cref{lst:remove-para1-yaml}. \begin{minipage}{.45\linewidth} - \cmhlistingsfromfile{demonstrations/shortlines.tex}{\texttt{shortlines.tex}}{lst:shortlines} + \cmhlistingsfromfile[showspaces=true]{demonstrations/shortlines.tex}{\texttt{shortlines.tex}}{lst:shortlines} \end{minipage} \hfill \begin{minipage}{.49\linewidth} @@ -185,7 +453,7 @@ \section{The \texttt{-m} (\texttt{modifylinebreaks}) switch}\label{sec:modifylin \end{commandshell} then we obtain the output given in \cref{lst:shortlines1}. - \cmhlistingsfromfile{demonstrations/shortlines1.tex}{\texttt{shortlines1.tex}}{lst:shortlines1} + \cmhlistingsfromfile[showspaces=true]{demonstrations/shortlines1.tex}{\texttt{shortlines1.tex}}{lst:shortlines1} Keen readers may notice that some trailing white space must be present in the file in \cref{lst:shortlines} which has crept in to the output in \cref{lst:shortlines1}. This can be fixed using the YAML file in @@ -196,7 +464,7 @@ \section{The \texttt{-m} (\texttt{modifylinebreaks}) switch}\label{sec:modifylin in which case the output is as in \cref{lst:shortlines1-tws}; notice that the double spaces present in \cref{lst:shortlines1} have been addressed. - \cmhlistingsfromfile{demonstrations/shortlines1-tws.tex}{\texttt{shortlines1-tws.tex}}{lst:shortlines1-tws} + \cmhlistingsfromfile[showspaces=true]{demonstrations/shortlines1-tws.tex}{\texttt{shortlines1-tws.tex}}{lst:shortlines1-tws} Keeping with the settings in \cref{lst:remove-para1-yaml}, we note that the \texttt{all} switch applies to \emph{all} code block types. So, for example, let's consider the files in \cref{lst:shortlines-mand,lst:shortlines-opt} @@ -282,7 +550,7 @@ \section{The \texttt{-m} (\texttt{modifylinebreaks}) switch}\label{sec:modifylin \announce{2017-05-27}{paragraphsStopAt} you can fine tune the behaviour of the routine further by using the \texttt{paragraphsStopAt} fields, shown in \cref{lst:paragraphsStopAt}. - \cmhlistingsfromfile[style=paragraphsStopAt]{../defaultSettings.yaml}[MLB-TCB,width=.85\linewidth,before=\centering]{\texttt{paragraphsStopAt}}{lst:paragraphsStopAt} + \cmhlistingsfromfile[style=paragraphsStopAt]*{../defaultSettings.yaml}[MLB-TCB,width=.85\linewidth,before=\centering]{\texttt{paragraphsStopAt}}{lst:paragraphsStopAt} The fields specified in \texttt{paragraphsStopAt} tell \texttt{latexindent.pl} to stop the current paragraph when it reaches a line that \emph{begins} with any of the code-block types specified as \texttt{1} in \cref{lst:paragraphsStopAt}. @@ -328,10 +596,10 @@ \section{The \texttt{-m} (\texttt{modifylinebreaks}) switch}\label{sec:modifylin \cmhlistingsfromfile{demonstrations/sl-stop4-command.tex}{\texttt{sl-stop4-command.tex}}{lst:sl-stop4-command} \cmhlistingsfromfile{demonstrations/sl-stop4-comment.tex}{\texttt{sl-stop4-comment.tex}}{lst:sl-stop4-comment} -\subsection{Poly-switches} +\subsection{Poly-switches}\label{sec:poly-switches} Every other field in the \texttt{modifyLineBreaks} field uses poly-switches, and can take one of \emph{five}% - \announce*{2017-08-21}*{blank line poly-switch} integer values: + \announce{2017-08-21}*{blank line poly-switch} integer values: \begin{itemize}[font=\bfseries] \item[$-1$] \emph{remove mode}: line breaks before or after the \emph{<part of thing>} can be removed (assuming that \texttt{preserveBlankLines} is set to \texttt{0}); \item[0] \emph{off mode}: line breaks will not be modified for the \emph{<part of thing>} under consideration; @@ -340,7 +608,7 @@ \subsection{Poly-switches} \item[2] \emph{comment then add mode}: a comment symbol will be added, followed by a line break before or after the \emph{<part of thing>} under consideration, assuming that there is not already a comment and line break before or after the \emph{<part of thing>}; \item[3] \emph{add then blank line mode}% - \announce*{2017-08-21}{blank line poly-switch}: a line break will be added before or after the \emph{<part of thing>} under consideration, assuming that + \announce{2017-08-21}{blank line poly-switch}: a line break will be added before or after the \emph{<part of thing>} under consideration, assuming that there is not already a line break before or after the \emph{<part of thing>}, followed by a blank line. \end{itemize} In the above, \emph{<part of thing>} refers to either the \emph{begin statement}, \emph{body} or \emph{end statement} of the @@ -352,25 +620,25 @@ \subsection{modifyLineBreaks for environments}\label{sec:modifylinebreaks-enviro after the \texttt{environments} field) and that \emph{per-name} settings are also allowed -- in the case of \cref{lst:environments-mlb}, settings for \texttt{equation*} have been specified. Note that all poly-switches are \emph{off} by default. - \cmhlistingsfromfile[style=modifylinebreaksEnv]{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,MLB-TCB]{\texttt{environments}}{lst:environments-mlb} + \cmhlistingsfromfile[style=modifylinebreaksEnv]*{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,MLB-TCB]{\texttt{environments}}{lst:environments-mlb} Let's begin with the simple example given in \cref{lst:env-mlb1-tex}; note that we have annotated key parts of the file using $\BeginStartsOnOwnLine$, $\BodyStartsOnOwnLine$, $\EndStartsOnOwnLine$ and $\EndFinishesWithLineBreak$, these will be related to fields specified in \cref{lst:environments-mlb}. - \begin{cmhlistings}[escapeinside={(*@}{@*)}]{\texttt{env-mlb1.tex}}{lst:env-mlb1-tex} + \begin{cmhlistings}[style=tcblatex,escapeinside={(*@}{@*)}]{\texttt{env-mlb1.tex}}{lst:env-mlb1-tex} before words(*@$\BeginStartsOnOwnLine$@*) \begin{myenv}(*@$\BodyStartsOnOwnLine$@*)body of myenv(*@$\EndStartsOnOwnLine$@*)\end{myenv}(*@$\EndFinishesWithLineBreak$@*) after words \end{cmhlistings} -\subsubsection{Adding line breaks using \texttt{BeginStartsOnOwnLine} and \texttt{BodyStartsOnOwnLine}} +\subsubsection[Adding line breaks: \texttt{BeginStartsOnOwnLine} and \texttt{BodyStartsOnOwnLine}]{Adding line breaks using \texttt{BeginStartsOnOwnLine} and \texttt{BodyStartsOnOwnLine}} Let's explore \texttt{BeginStartsOnOwnLine} and \texttt{BodyStartsOnOwnLine} in \cref{lst:env-mlb1,lst:env-mlb2}, and in particular, let's allow each of them in turn to take a value of $1$. \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/env-mlb1.yaml}[MLB-TCB]{\texttt{env-mlb1.yaml}}{lst:env-mlb1} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/env-mlb1.yaml}[MLB-TCB]{\texttt{env-mlb1.yaml}}{lst:env-mlb1} \end{minipage} \hfill \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/env-mlb2.yaml}[MLB-TCB]{\texttt{env-mlb2.yaml}}{lst:env-mlb2} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/env-mlb2.yaml}[MLB-TCB]{\texttt{env-mlb2.yaml}}{lst:env-mlb2} \end{minipage} After running the following commands, @@ -402,11 +670,11 @@ \subsubsection{Adding line breaks using \texttt{BeginStartsOnOwnLine} and \textt save them into \texttt{env-mlb3.yaml} and \texttt{env-mlb4.yaml} respectively (see \cref{lst:env-mlb3,lst:env-mlb4}). \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/env-mlb3.yaml}[MLB-TCB]{\texttt{env-mlb3.yaml}}{lst:env-mlb3} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/env-mlb3.yaml}[MLB-TCB]{\texttt{env-mlb3.yaml}}{lst:env-mlb3} \end{minipage} \hfill \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/env-mlb4.yaml}[MLB-TCB]{\texttt{env-mlb4.yaml}}{lst:env-mlb4} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/env-mlb4.yaml}[MLB-TCB]{\texttt{env-mlb4.yaml}}{lst:env-mlb4} \end{minipage} Upon running commands analogous to the above, we obtain \cref{lst:env-mlb-mod3,lst:env-mlb-mod4}. @@ -426,42 +694,42 @@ \subsubsection{Adding line breaks using \texttt{BeginStartsOnOwnLine} and \textt space has been stripped before doing so. Let's% - \announce*{2017-08-21}{demonstration of blank line poly-switch (3)} now change each of the \texttt{1} values in \cref{lst:env-mlb1,lst:env-mlb2} so that they are $3$ and + \announce{2017-08-21}{demonstration of blank line poly-switch (3)} now change each of the \texttt{1} values in \cref{lst:env-mlb1,lst:env-mlb2} so that they are $3$ and save them into \texttt{env-mlb5.yaml} and \texttt{env-mlb6.yaml} respectively (see \cref{lst:env-mlb5,lst:env-mlb6}). \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile*[style=yaml-LST]{demonstrations/env-mlb5.yaml}[MLB-TCB]{\texttt{env-mlb5.yaml}}{lst:env-mlb5} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/env-mlb5.yaml}[MLB-TCB]{\texttt{env-mlb5.yaml}}{lst:env-mlb5} \end{minipage} \hfill \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile*[style=yaml-LST]{demonstrations/env-mlb6.yaml}[MLB-TCB]{\texttt{env-mlb6.yaml}}{lst:env-mlb6} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/env-mlb6.yaml}[MLB-TCB]{\texttt{env-mlb6.yaml}}{lst:env-mlb6} \end{minipage} Upon running commands analogous to the above, we obtain \cref{lst:env-mlb-mod5,lst:env-mlb-mod6}. \begin{widepage} \begin{minipage}{.56\linewidth} - \cmhlistingsfromfile*{demonstrations/env-mlb-mod5.tex}{\texttt{env-mlb.tex} using \cref{lst:env-mlb5}}{lst:env-mlb-mod5} + \cmhlistingsfromfile{demonstrations/env-mlb-mod5.tex}{\texttt{env-mlb.tex} using \cref{lst:env-mlb5}}{lst:env-mlb-mod5} \end{minipage} \hfill \begin{minipage}{.43\linewidth} - \cmhlistingsfromfile*{demonstrations/env-mlb-mod6.tex}{\texttt{env-mlb.tex} using \cref{lst:env-mlb6}}{lst:env-mlb-mod6} + \cmhlistingsfromfile{demonstrations/env-mlb-mod6.tex}{\texttt{env-mlb.tex} using \cref{lst:env-mlb6}}{lst:env-mlb-mod6} \end{minipage} \end{widepage} Note that line breaks have been added as in \cref{lst:env-mlb-mod1,lst:env-mlb-mod2}, but this time a \emph{blank line} has been added after adding the line break. -\subsubsection{Adding line breaks using \texttt{EndStartsOnOwnLine} and \texttt{EndFinishesWithLineBreak}} +\subsubsection[Adding line breaks: \texttt{EndStartsOnOwnLine} and \texttt{EndFinishesWithLineBreak}]{Adding line breaks using \texttt{EndStartsOnOwnLine} and \texttt{EndFinishesWithLineBreak}} Let's explore \texttt{EndStartsOnOwnLine} and \texttt{EndFinishesWithLineBreak} in \cref{lst:env-mlb7,lst:env-mlb8}, and in particular, let's allow each of them in turn to take a value of $1$. \begin{minipage}{.49\textwidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/env-mlb7.yaml}[MLB-TCB]{\texttt{env-mlb7.yaml}}{lst:env-mlb7} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/env-mlb7.yaml}[MLB-TCB]{\texttt{env-mlb7.yaml}}{lst:env-mlb7} \end{minipage} \hfill \begin{minipage}{.49\textwidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/env-mlb8.yaml}[MLB-TCB]{\texttt{env-mlb8.yaml}}{lst:env-mlb8} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/env-mlb8.yaml}[MLB-TCB]{\texttt{env-mlb8.yaml}}{lst:env-mlb8} \end{minipage} After running the following commands, @@ -492,11 +760,11 @@ \subsubsection{Adding line breaks using \texttt{EndStartsOnOwnLine} and \texttt{ save them into \texttt{env-mlb9.yaml} and \texttt{env-mlb10.yaml} respectively (see \cref{lst:env-mlb9,lst:env-mlb10}). \begin{minipage}{.49\textwidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/env-mlb9.yaml}[MLB-TCB]{\texttt{env-mlb9.yaml}}{lst:env-mlb9} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/env-mlb9.yaml}[MLB-TCB]{\texttt{env-mlb9.yaml}}{lst:env-mlb9} \end{minipage} \hfill \begin{minipage}{.49\textwidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/env-mlb10.yaml}[MLB-TCB]{\texttt{env-mlb10.yaml}}{lst:env-mlb10} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/env-mlb10.yaml}[MLB-TCB]{\texttt{env-mlb10.yaml}}{lst:env-mlb10} \end{minipage} Upon running commands analogous to the above, we obtain \cref{lst:env-mlb-mod9,lst:env-mlb-mod10}. @@ -516,26 +784,26 @@ \subsubsection{Adding line breaks using \texttt{EndStartsOnOwnLine} and \texttt{ space has been stripped before doing so. Let's% - \announce*{2017-08-21}{demonstration of blank line poly-switch (3)} now change each of the \texttt{1} values in \cref{lst:env-mlb7,lst:env-mlb8} so that they are $3$ and + \announce{2017-08-21}{demonstration of blank line poly-switch (3)} now change each of the \texttt{1} values in \cref{lst:env-mlb7,lst:env-mlb8} so that they are $3$ and save them into \texttt{env-mlb11.yaml} and \texttt{env-mlb12.yaml} respectively (see \cref{lst:env-mlb11,lst:env-mlb12}). \begin{minipage}{.49\textwidth} - \cmhlistingsfromfile*[style=yaml-LST]{demonstrations/env-mlb11.yaml}[MLB-TCB]{\texttt{env-mlb11.yaml}}{lst:env-mlb11} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/env-mlb11.yaml}[MLB-TCB]{\texttt{env-mlb11.yaml}}{lst:env-mlb11} \end{minipage} \hfill \begin{minipage}{.49\textwidth} - \cmhlistingsfromfile*[style=yaml-LST]{demonstrations/env-mlb12.yaml}[MLB-TCB]{\texttt{env-mlb12.yaml}}{lst:env-mlb12} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/env-mlb12.yaml}[MLB-TCB]{\texttt{env-mlb12.yaml}}{lst:env-mlb12} \end{minipage} Upon running commands analogous to the above, we obtain \cref{lst:env-mlb-mod11,lst:env-mlb-mod12}. \begin{widepage} \begin{minipage}{.42\linewidth} - \cmhlistingsfromfile*{demonstrations/env-mlb-mod11.tex}{\texttt{env-mlb.tex} using \cref{lst:env-mlb11}}{lst:env-mlb-mod11} + \cmhlistingsfromfile{demonstrations/env-mlb-mod11.tex}{\texttt{env-mlb.tex} using \cref{lst:env-mlb11}}{lst:env-mlb-mod11} \end{minipage} \hfill \begin{minipage}{.57\linewidth} - \cmhlistingsfromfile*{demonstrations/env-mlb-mod12.tex}{\texttt{env-mlb.tex} using \cref{lst:env-mlb12}}{lst:env-mlb-mod12} + \cmhlistingsfromfile{demonstrations/env-mlb-mod12.tex}{\texttt{env-mlb.tex} using \cref{lst:env-mlb12}}{lst:env-mlb-mod12} \end{minipage} \end{widepage} @@ -582,7 +850,7 @@ \subsubsection{Removing line breaks (poly-switches set to $-1$)} and $\EndFinishesWithLineBreak$, together with the associated YAML files in \crefrange{lst:env-mlb13}{lst:env-mlb16}. \begin{minipage}{.45\linewidth} - \begin{cmhlistings}[escapeinside={(*@}{@*)}]{\texttt{env-mlb4.tex}}{lst:mlb4} + \begin{cmhlistings}[style=tcblatex,escapeinside={(*@}{@*)}]{\texttt{env-mlb4.tex}}{lst:mlb4} before words(*@$\BeginStartsOnOwnLine$@*) \begin{myenv}(*@$\BodyStartsOnOwnLine$@*) body of myenv(*@$\EndStartsOnOwnLine$@*) @@ -592,13 +860,13 @@ \subsubsection{Removing line breaks (poly-switches set to $-1$)} \end{minipage}% \hfill \begin{minipage}{.51\textwidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/env-mlb13.yaml}[MLB-TCB]{\texttt{env-mlb13.yaml}}{lst:env-mlb13} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/env-mlb13.yaml}[MLB-TCB]{\texttt{env-mlb13.yaml}}{lst:env-mlb13} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/env-mlb14.yaml}[MLB-TCB]{\texttt{env-mlb14.yaml}}{lst:env-mlb14} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/env-mlb14.yaml}[MLB-TCB]{\texttt{env-mlb14.yaml}}{lst:env-mlb14} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/env-mlb15.yaml}[MLB-TCB]{\texttt{env-mlb15.yaml}}{lst:env-mlb15} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/env-mlb15.yaml}[MLB-TCB]{\texttt{env-mlb15.yaml}}{lst:env-mlb15} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/env-mlb16.yaml}[MLB-TCB]{\texttt{env-mlb16.yaml}}{lst:env-mlb16} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/env-mlb16.yaml}[MLB-TCB]{\texttt{env-mlb16.yaml}}{lst:env-mlb16} \end{minipage} After running the commands @@ -651,7 +919,7 @@ \subsubsection{About trailing horizontal space} file shown in \cref{lst:mlb5}, which highlights trailing spaces. \begin{minipage}{.45\linewidth} - \begin{cmhlistings}[showspaces=true,escapeinside={(*@}{@*)}]{\texttt{env-mlb5.tex}}{lst:mlb5} + \begin{cmhlistings}[style=tcblatex,showspaces=true,escapeinside={(*@}{@*)}]{\texttt{env-mlb5.tex}}{lst:mlb5} before words (*@$\BeginStartsOnOwnLine$@*) \begin{myenv} (*@$\BodyStartsOnOwnLine$@*) body of myenv (*@$\EndStartsOnOwnLine$@*) @@ -661,7 +929,7 @@ \subsubsection{About trailing horizontal space} \end{minipage} \hfill \begin{minipage}{.45\linewidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/removeTWS-before.yaml}[yaml-TCB]{\texttt{removeTWS-before.yaml}}{lst:removeTWS-before} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/removeTWS-before.yaml}[yaml-TCB]{\texttt{removeTWS-before.yaml}}{lst:removeTWS-before} \end{minipage} The output from the following commands @@ -676,16 +944,16 @@ \subsubsection{About trailing horizontal space} in \cref{lst:env-mlb5-modAll-remove-WS}, it has been removed using the switch specified in \cref{lst:removeTWS-before}. \begin{widepage} - \cmhlistingsfromfile{demonstrations/env-mlb5-modAll.tex}{\texttt{env-mlb5.tex} using \crefrange{lst:env-mlb4-mod13}{lst:env-mlb4-mod16}}{lst:env-mlb5-modAll} + \cmhlistingsfromfile[showspaces=true]{demonstrations/env-mlb5-modAll.tex}{\texttt{env-mlb5.tex} using \crefrange{lst:env-mlb4-mod13}{lst:env-mlb4-mod16}}{lst:env-mlb5-modAll} - \cmhlistingsfromfile{demonstrations/env-mlb5-modAll-remove-WS.tex}{\texttt{env-mlb5.tex} using \crefrange{lst:env-mlb4-mod13}{lst:env-mlb4-mod16} \emph{and} \cref{lst:removeTWS-before}}{lst:env-mlb5-modAll-remove-WS} + \cmhlistingsfromfile[showspaces=true]{demonstrations/env-mlb5-modAll-remove-WS.tex}{\texttt{env-mlb5.tex} using \crefrange{lst:env-mlb4-mod13}{lst:env-mlb4-mod16} \emph{and} \cref{lst:removeTWS-before}}{lst:env-mlb5-modAll-remove-WS} \end{widepage} \subsubsection{poly-switch line break removal and blank lines} Now let's consider the file in \cref{lst:mlb6}, which contains blank lines. \begin{minipage}{.45\linewidth} - \begin{cmhlistings}[escapeinside={(*@}{@*)}]{\texttt{env-mlb6.tex}}{lst:mlb6} + \begin{cmhlistings}[style=tcblatex,escapeinside={(*@}{@*)}]{\texttt{env-mlb6.tex}}{lst:mlb6} before words(*@$\BeginStartsOnOwnLine$@*) @@ -702,7 +970,7 @@ \subsubsection{poly-switch line break removal and blank lines} \end{minipage}% \hfill \begin{minipage}{.45\linewidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/UnpreserveBlankLines.yaml}[MLB-TCB]{\texttt{UnpreserveBlankLines.yaml}}{lst:UnpreserveBlankLines} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/UnpreserveBlankLines.yaml}[MLB-TCB]{\texttt{UnpreserveBlankLines.yaml}}{lst:UnpreserveBlankLines} \end{minipage} Upon running the following commands @@ -731,7 +999,7 @@ \subsubsection{poly-switch line break removal and blank lines} We can explore this further using the blank-line poly-switch value of $3$; let's use the file given in \cref{lst:env-mlb7-tex}. - \cmhlistingsfromfile*{demonstrations/env-mlb7.tex}{\texttt{env-mlb7.tex}}{lst:env-mlb7-tex} + \cmhlistingsfromfile{demonstrations/env-mlb7.tex}{\texttt{env-mlb7.tex}}{lst:env-mlb7-tex} Upon running the following commands \begin{commandshell} @@ -740,8 +1008,8 @@ \subsubsection{poly-switch line break removal and blank lines} \end{commandshell} we receive the outputs given in \cref{lst:env-mlb7-preserve,lst:env-mlb7-no-preserve}. - \cmhlistingsfromfile*{demonstrations/env-mlb7-preserve.tex}{\texttt{env-mlb7-preserve.tex}}{lst:env-mlb7-preserve} - \cmhlistingsfromfile*{demonstrations/env-mlb7-no-preserve.tex}{\texttt{env-mlb7-no-preserve.tex}}{lst:env-mlb7-no-preserve} + \cmhlistingsfromfile{demonstrations/env-mlb7-preserve.tex}{\texttt{env-mlb7-preserve.tex}}{lst:env-mlb7-preserve} + \cmhlistingsfromfile{demonstrations/env-mlb7-no-preserve.tex}{\texttt{env-mlb7-no-preserve.tex}}{lst:env-mlb7-no-preserve} Notice that in: \begin{itemize} @@ -764,7 +1032,7 @@ \subsection{Poly-switches for other code blocks} Code block & Sample & Poly-switch mapping \\ \midrule environment & - \begin{lstlisting}[escapeinside={(*@}{@*)},nolol=true] + \begin{lstlisting}[style=tcblatex,escapeinside={(*@}{@*)},nolol=true] before words(*@$\BeginStartsOnOwnLine$@*) \begin{myenv}(*@$\BodyStartsOnOwnLine$@*) body of myenv(*@$\EndStartsOnOwnLine$@*) @@ -781,7 +1049,7 @@ \subsection{Poly-switches for other code blocks} \\ \cmidrule{2-3} ifelsefi & - \begin{lstlisting}[escapeinside={(*@}{@*)},nolol=true] + \begin{lstlisting}[style=tcblatex,escapeinside={(*@}{@*)},nolol=true] before words(*@$\BeginStartsOnOwnLine$@*) \if...(*@$\BodyStartsOnOwnLine$@*) body of if statement(*@$\ElseStartsOnOwnLine$@*) @@ -802,7 +1070,7 @@ \subsection{Poly-switches for other code blocks} \\ \cmidrule{2-3} optionalArguments & - \begin{lstlisting}[escapeinside={(*@}{@*)},nolol=true] + \begin{lstlisting}[style=tcblatex,escapeinside={(*@}{@*)},nolol=true] ...(*@$\BeginStartsOnOwnLine$@*) [(*@$\BodyStartsOnOwnLine$@*) body of opt arg(*@$\EndStartsOnOwnLine$@*) @@ -819,7 +1087,7 @@ \subsection{Poly-switches for other code blocks} \\ \cmidrule{2-3} mandatoryArguments & - \begin{lstlisting}[escapeinside={(*@}{@*)},nolol=true] + \begin{lstlisting}[style=tcblatex,escapeinside={(*@}{@*)},nolol=true] ...(*@$\BeginStartsOnOwnLine$@*) {(*@$\BodyStartsOnOwnLine$@*) body of mand arg(*@$\EndStartsOnOwnLine$@*) @@ -836,7 +1104,7 @@ \subsection{Poly-switches for other code blocks} \\ \cmidrule{2-3} commands & - \begin{lstlisting}[escapeinside={(*@}{@*)},morekeywords={mycommand},nolol=true,] + \begin{lstlisting}[style=tcblatex,escapeinside={(*@}{@*)},morekeywords={mycommand},nolol=true,] before words(*@$\BeginStartsOnOwnLine$@*) \mycommand(*@$\BodyStartsOnOwnLine$@*) (*@$\langle$\itshape{arguments}$\rangle$@*) @@ -849,7 +1117,7 @@ \subsection{Poly-switches for other code blocks} \\ \cmidrule{2-3} namedGroupingBraces Brackets & - \begin{lstlisting}[escapeinside={(*@}{@*)},morekeywords={myname},nolol=true,] + \begin{lstlisting}[style=tcblatex,escapeinside={(*@}{@*)},morekeywords={myname},nolol=true,] before words(*@$\BeginStartsOnOwnLine$@*) myname(*@$\BodyStartsOnOwnLine$@*) (*@$\langle$\itshape{braces/brackets}$\rangle$@*) @@ -862,7 +1130,7 @@ \subsection{Poly-switches for other code blocks} \\ \cmidrule{2-3} keyEqualsValuesBraces\newline Brackets & - \begin{lstlisting}[escapeinside={(*@}{@*)},morekeywords={key},nolol=true,] + \begin{lstlisting}[style=tcblatex,escapeinside={(*@}{@*)},morekeywords={key},nolol=true,] before words(*@$\BeginStartsOnOwnLine$@*) key(*@$\EqualsStartsOnOwnLine$@*)=(*@$\BodyStartsOnOwnLine$@*) (*@$\langle$\itshape{braces/brackets}$\rangle$@*) @@ -876,7 +1144,7 @@ \subsection{Poly-switches for other code blocks} \\ \cmidrule{2-3} items & - \begin{lstlisting}[escapeinside={(*@}{@*)},nolol=true] + \begin{lstlisting}[style=tcblatex,escapeinside={(*@}{@*)},nolol=true] before words(*@$\BeginStartsOnOwnLine$@*) \item(*@$\BodyStartsOnOwnLine$@*) ... @@ -889,7 +1157,7 @@ \subsection{Poly-switches for other code blocks} \\ \cmidrule{2-3} specialBeginEnd & - \begin{lstlisting}[escapeinside={(*@}{@*)},nolol=true] + \begin{lstlisting}[style=tcblatex,escapeinside={(*@}{@*)},nolol=true] before words(*@$\BeginStartsOnOwnLine$@*) \[(*@$\BodyStartsOnOwnLine$@*) body of special(*@$\EndStartsOnOwnLine$@*) diff --git a/documentation/subsec-commands-and-their-options.tex b/documentation/subsec-commands-and-their-options.tex index 60033921..fb967252 100644 --- a/documentation/subsec-commands-and-their-options.tex +++ b/documentation/subsec-commands-and-their-options.tex @@ -8,9 +8,9 @@ \subsection{Commands and the strings between their arguments}\label{subsec:comma \yamltitle{commandCodeBlocks}*{fields} The \texttt{commandCodeBlocks} field% - \announce*{2017-08-21}*{commandCodeBlocks} contains a few switches detailed in \cref{lst:commandCodeBlocks}. + \announce{2017-08-21}*{commandCodeBlocks} contains a few switches detailed in \cref{lst:commandCodeBlocks}. - \cmhlistingsfromfile*[style=commandCodeBlocks]{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{commandCodeBlocks}}{lst:commandCodeBlocks} + \cmhlistingsfromfile[style=commandCodeBlocks]*{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{commandCodeBlocks}}{lst:commandCodeBlocks} \yamltitle{roundParenthesesAllowed}{0|1} @@ -18,11 +18,11 @@ \subsection{Commands and the strings between their arguments}\label{subsec:comma let's consider the code given in \cref{lst:pstricks1}. \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile[columns=fixed]{demonstrations/pstricks1.tex}{\texttt{pstricks1.tex}}{lst:pstricks1} + \cmhlistingsfromfile{demonstrations/pstricks1.tex}{\texttt{pstricks1.tex}}{lst:pstricks1} \end{minipage} \hfill \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile[columns=fixed]{demonstrations/pstricks1-default.tex}{\texttt{pstricks1} default output}{lst:pstricks1-default} + \cmhlistingsfromfile{demonstrations/pstricks1-default.tex}{\texttt{pstricks1} default output}{lst:pstricks1-default} \end{minipage} Notice that the \lstinline!\defFunction! command has an optional argument, followed by a @@ -46,7 +46,7 @@ \subsection{Commands and the strings between their arguments}\label{subsec:comma \end{minipage} \hfill \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/noRoundParentheses.yaml}[yaml-TCB]{\texttt{noRoundParentheses.yaml}}{lst:noRoundParentheses} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/noRoundParentheses.yaml}[yaml-TCB]{\texttt{noRoundParentheses.yaml}}{lst:noRoundParentheses} \end{minipage} Notice the difference between \cref{lst:pstricks1-default} and \cref{lst:pstricks1-nrp}; in particular, in \cref{lst:pstricks1-nrp}, because @@ -61,11 +61,11 @@ \subsection{Commands and the strings between their arguments}\label{subsec:comma then the output is as in \cref{lst:pstricks1-indent-rules}. \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile{demonstrations/pstricks1-indent-rules.tex}{\texttt{pstricks1.tex} using \cref{lst:defFunction}}{lst:pstricks1-indent-rules} + \cmhlistingsfromfile[showspaces=true]{demonstrations/pstricks1-indent-rules.tex}{\texttt{pstricks1.tex} using \cref{lst:defFunction}}{lst:pstricks1-indent-rules} \end{minipage} \hfill \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/defFunction.yaml}[yaml-TCB]{\texttt{defFunction.yaml}}{lst:defFunction} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/defFunction.yaml}[yaml-TCB]{\texttt{defFunction.yaml}}{lst:defFunction} \end{minipage} Notice in \cref{lst:pstricks1-indent-rules} that the \emph{body} of the \lstinline!defFunction! command i.e, the subsequent lines @@ -76,11 +76,11 @@ \subsection{Commands and the strings between their arguments}\label{subsec:comma \texttt{latexindent.pl} gives the default output in \cref{lst:tikz-node1-default}. \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile[columns=fixed]{demonstrations/tikz-node1.tex}{\texttt{tikz-node1.tex}}{lst:tikz-node1} + \cmhlistingsfromfile[columns=fixed]*{demonstrations/tikz-node1.tex}{\texttt{tikz-node1.tex}}{lst:tikz-node1} \end{minipage} \hfill \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile[columns=fixed]{demonstrations/tikz-node1-default.tex}{\texttt{tikz-node1} default output}{lst:tikz-node1-default} + \cmhlistingsfromfile[columns=fixed]*{demonstrations/tikz-node1-default.tex}{\texttt{tikz-node1} default output}{lst:tikz-node1-default} \end{minipage} With reference to \vref{lst:commandCodeBlocks}, we see that the strings @@ -108,11 +108,11 @@ \subsection{Commands and the strings between their arguments}\label{subsec:comma we receive the output given in \cref{lst:tikz-node1-draw}. \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile{demonstrations/tikz-node1-draw.tex}{\texttt{tikz-node1.tex} using \cref{lst:draw}}{lst:tikz-node1-draw} + \cmhlistingsfromfile[showspaces=true]{demonstrations/tikz-node1-draw.tex}{\texttt{tikz-node1.tex} using \cref{lst:draw}}{lst:tikz-node1-draw} \end{minipage} \hfill \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/draw.yaml}[yaml-TCB]{\texttt{draw.yaml}}{lst:draw} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/draw.yaml}[yaml-TCB]{\texttt{draw.yaml}}{lst:draw} \end{minipage} Notice that each line after the \lstinline!\draw! command (its `body') in \cref{lst:tikz-node1-draw} has been given the @@ -129,7 +129,7 @@ \subsection{Commands and the strings between their arguments}\label{subsec:comma \end{minipage} \hfill \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/no-to.yaml}[yaml-TCB]{\texttt{no-to.yaml}}{lst:no-to} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/no-to.yaml}[yaml-TCB]{\texttt{no-to.yaml}}{lst:no-to} \end{minipage} In this case, \texttt{latexindent.pl} sees that: @@ -141,7 +141,7 @@ \subsection{Commands and the strings between their arguments}\label{subsec:comma \yamltitle{commandNameSpecial}*{fields} There are some special command names% - \announce*{2017-08-21}{commandNameSpecial} that do not fit within the names recognized by \texttt{latexindent.pl}, + \announce{2017-08-21}{commandNameSpecial} that do not fit within the names recognized by \texttt{latexindent.pl}, the first one of which is \lstinline!\@ifnextchar[!. From the perspective of \texttt{latexindent.pl}, the whole of the text \lstinline!\@ifnextchar[! is is a command, because it is immediately followed by sets of mandatory arguments. However, without the \texttt{commandNameSpecial} field, \texttt{latexindent.pl} @@ -150,11 +150,11 @@ \subsection{Commands and the strings between their arguments}\label{subsec:comma For example, consider the sample file in \cref{lst:ifnextchar}, which has default output in \cref{lst:ifnextchar-default}. \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile*{demonstrations/ifnextchar.tex}{\texttt{ifnextchar.tex}}{lst:ifnextchar} + \cmhlistingsfromfile{demonstrations/ifnextchar.tex}{\texttt{ifnextchar.tex}}{lst:ifnextchar} \end{minipage} \hfill \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile*{demonstrations/ifnextchar-default.tex}{\texttt{ifnextchar.tex} default output}{lst:ifnextchar-default} + \cmhlistingsfromfile{demonstrations/ifnextchar-default.tex}{\texttt{ifnextchar.tex} default output}{lst:ifnextchar-default} \end{minipage} Notice that in \cref{lst:ifnextchar-default} the \texttt{parbox} command has been able to indent its body, because \texttt{latexindent.pl} @@ -166,9 +166,9 @@ \subsection{Commands and the strings between their arguments}\label{subsec:comma command has not been found. \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile*{demonstrations/ifnextchar-off.tex}{\texttt{ifnextchar.tex} using \cref{lst:no-ifnextchar}}{lst:ifnextchar-off} + \cmhlistingsfromfile{demonstrations/ifnextchar-off.tex}{\texttt{ifnextchar.tex} using \cref{lst:no-ifnextchar}}{lst:ifnextchar-off} \end{minipage} \hfill \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile*[style=yaml-LST]{demonstrations/no-ifnextchar.yaml}[yaml-TCB]{\texttt{no-ifnextchar.yaml}}{lst:no-ifnextchar} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/no-ifnextchar.yaml}[yaml-TCB]{\texttt{no-ifnextchar.yaml}}{lst:no-ifnextchar} \end{minipage} diff --git a/documentation/subsec-conflicting-poly-switches.tex b/documentation/subsec-conflicting-poly-switches.tex index b08cb456..d6c158a3 100644 --- a/documentation/subsec-conflicting-poly-switches.tex +++ b/documentation/subsec-conflicting-poly-switches.tex @@ -12,7 +12,7 @@ \subsection{Conflicting poly-switches: sequential code blocks} \end{minipage} \hfill \begin{minipage}{.55\linewidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/mycom-mlb4.yaml}[MLB-TCB,width=\linewidth]{\texttt{mycom-mlb4.yaml}}{lst:mycom-mlb4} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/mycom-mlb4.yaml}[MLB-TCB,width=\linewidth]{\texttt{mycom-mlb4.yaml}}{lst:mycom-mlb4} \end{minipage} Studying \cref{lst:mycom-mlb4}, we see that the two poly-switches are at opposition with one another: @@ -35,7 +35,7 @@ \subsection{Conflicting poly-switches: sequential code blocks} \end{minipage} \hfill \begin{minipage}{.55\linewidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/mycom-mlb5.yaml}[MLB-TCB,width=\linewidth]{\texttt{mycom-mlb5.yaml}}{lst:mycom-mlb5} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/mycom-mlb5.yaml}[MLB-TCB,width=\linewidth]{\texttt{mycom-mlb5.yaml}}{lst:mycom-mlb5} \end{minipage} As previously, the most-recently-processed code block takes priority -- as before, the second (i.e, \emph{last}) argument. Exploring this @@ -46,7 +46,7 @@ \subsection{Conflicting poly-switches: sequential code blocks} \end{minipage} \hfill \begin{minipage}{.55\linewidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/mycom-mlb6.yaml}[MLB-TCB,width=\linewidth]{\texttt{mycom-mlb6.yaml}}{lst:mycom-mlb6} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/mycom-mlb6.yaml}[MLB-TCB,width=\linewidth]{\texttt{mycom-mlb6.yaml}}{lst:mycom-mlb6} \end{minipage} Note that a \lstinline!%! \emph{has} been added to the trailing first \lstinline!}!; this is because: @@ -73,7 +73,7 @@ \subsection{Conflicting poly-switches: nested code blocks} \end{minipage} \hfill \begin{minipage}{.55\linewidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/nested-env-mlb1.yaml}[MLB-TCB,width=\linewidth]{\texttt{nested-env-mlb1.yaml}}{lst:nested-env-mlb1-yaml} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/nested-env-mlb1.yaml}[MLB-TCB,width=\linewidth]{\texttt{nested-env-mlb1.yaml}}{lst:nested-env-mlb1-yaml} \end{minipage} In \cref{lst:nested-env-mlb1}, let's first of all note that both environments have received the appropriate (default) indentation; secondly, @@ -121,7 +121,7 @@ \subsection{Conflicting poly-switches: nested code blocks} \end{minipage} \hfill \begin{minipage}{.55\linewidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/nested-env-mlb2.yaml}[MLB-TCB,width=\linewidth]{\texttt{nested-env-mlb2.yaml}}{lst:nested-env-mlb2} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/nested-env-mlb2.yaml}[MLB-TCB,width=\linewidth]{\texttt{nested-env-mlb2.yaml}}{lst:nested-env-mlb2} \end{minipage} During Phase 1: diff --git a/documentation/subsec-partnering-poly-switches.tex b/documentation/subsec-partnering-poly-switches.tex index d906fe84..9a788acb 100644 --- a/documentation/subsec-partnering-poly-switches.tex +++ b/documentation/subsec-partnering-poly-switches.tex @@ -21,7 +21,7 @@ \subsection{Partnering \texttt{BodyStartsOnOwnLine} with argument-based poly-swi \end{minipage} \hfill \begin{minipage}{.55\linewidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/mycom-mlb1.yaml}[MLB-TCB,width=\linewidth]{\texttt{mycom-mlb1.yaml}}{lst:mycom-mlb1} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/mycom-mlb1.yaml}[MLB-TCB,width=\linewidth]{\texttt{mycom-mlb1.yaml}}{lst:mycom-mlb1} \end{minipage} Now let's change the YAML file so that it is as in \cref{lst:mycom-mlb2}; upon running the analogous command to that given above, @@ -32,7 +32,7 @@ \subsection{Partnering \texttt{BodyStartsOnOwnLine} with argument-based poly-swi \end{minipage} \hfill \begin{minipage}{.55\linewidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/mycom-mlb2.yaml}[MLB-TCB,width=\linewidth]{\texttt{mycom-mlb2.yaml}}{lst:mycom-mlb2} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/mycom-mlb2.yaml}[MLB-TCB,width=\linewidth]{\texttt{mycom-mlb2.yaml}}{lst:mycom-mlb2} \end{minipage} Now let's change the YAML file so that it is as in \cref{lst:mycom-mlb3}; upon running the analogous command to that given above, @@ -43,5 +43,5 @@ \subsection{Partnering \texttt{BodyStartsOnOwnLine} with argument-based poly-swi \end{minipage} \hfill \begin{minipage}{.55\linewidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/mycom-mlb3.yaml}[MLB-TCB,width=\linewidth]{\texttt{mycom-mlb3.yaml}}{lst:mycom-mlb3} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/mycom-mlb3.yaml}[MLB-TCB,width=\linewidth]{\texttt{mycom-mlb3.yaml}}{lst:mycom-mlb3} \end{minipage} diff --git a/documentation/subsubsec-commands-with-arguments.tex b/documentation/subsubsec-commands-with-arguments.tex index 592e7fe4..633d74e7 100644 --- a/documentation/subsubsec-commands-with-arguments.tex +++ b/documentation/subsubsec-commands-with-arguments.tex @@ -16,11 +16,11 @@ \subsubsection{Commands with arguments}\label{subsubsec:commands-arguments} either in `scalar' form, or in `field' form, as shown in \cref{lst:mycommand-noAdd1,lst:mycommand-noAdd2} \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/mycommand-noAdd1.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{mycommand-noAdd1.yaml}}{lst:mycommand-noAdd1} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/mycommand-noAdd1.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{mycommand-noAdd1.yaml}}{lst:mycommand-noAdd1} \end{minipage} \hfill \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/mycommand-noAdd2.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{mycommand-noAdd2.yaml}}{lst:mycommand-noAdd2} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/mycommand-noAdd2.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{mycommand-noAdd2.yaml}}{lst:mycommand-noAdd2} \end{minipage} After running the following commands, @@ -46,11 +46,11 @@ \subsubsection{Commands with arguments}\label{subsubsec:commands-arguments} are given in \cref{lst:mycommand-noAdd3,lst:mycommand-noAdd4}. \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/mycommand-noAdd3.yaml}[width=.9\linewidth,before=\centering,yaml-TCB]{\texttt{mycommand-noAdd3.yaml}}{lst:mycommand-noAdd3} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/mycommand-noAdd3.yaml}[width=.9\linewidth,before=\centering,yaml-TCB]{\texttt{mycommand-noAdd3.yaml}}{lst:mycommand-noAdd3} \end{minipage} \hfill \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/mycommand-noAdd4.yaml}[width=.9\linewidth,before=\centering,yaml-TCB]{\texttt{mycommand-noAdd4.yaml}}{lst:mycommand-noAdd4} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/mycommand-noAdd4.yaml}[width=.9\linewidth,before=\centering,yaml-TCB]{\texttt{mycommand-noAdd4.yaml}}{lst:mycommand-noAdd4} \end{minipage} After running the following commands, @@ -74,11 +74,11 @@ \subsubsection{Commands with arguments}\label{subsubsec:commands-arguments} fixed as in \cref{lst:mycommand-noAdd5,lst:mycommand-noAdd6}.\label{page:command:noAddGlobal} \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/mycommand-noAdd5.yaml}[width=.9\linewidth,before=\centering,yaml-TCB]{\texttt{mycommand-noAdd5.yaml}}{lst:mycommand-noAdd5} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/mycommand-noAdd5.yaml}[width=.9\linewidth,before=\centering,yaml-TCB]{\texttt{mycommand-noAdd5.yaml}}{lst:mycommand-noAdd5} \end{minipage} \hfill \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/mycommand-noAdd6.yaml}[width=.9\linewidth,before=\centering,yaml-TCB]{\texttt{mycommand-noAdd6.yaml}}{lst:mycommand-noAdd6} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/mycommand-noAdd6.yaml}[width=.9\linewidth,before=\centering,yaml-TCB]{\texttt{mycommand-noAdd6.yaml}}{lst:mycommand-noAdd6} \end{minipage} After running the following commands, diff --git a/documentation/subsubsec-environments-and-their-arguments.tex b/documentation/subsubsec-environments-and-their-arguments.tex index c26e3591..65e63c2b 100644 --- a/documentation/subsubsec-environments-and-their-arguments.tex +++ b/documentation/subsubsec-environments-and-their-arguments.tex @@ -10,11 +10,11 @@ \subsubsection{Environments and their arguments}\label{subsubsec:env-and-their-a as demonstrated in \cref{lst:myenv-noAdd1,lst:myenv-noAdd2}. \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/myenv-noAdd1.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{myenv-noAdd1.yaml}}{lst:myenv-noAdd1} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/myenv-noAdd1.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{myenv-noAdd1.yaml}}{lst:myenv-noAdd1} \end{minipage} \hfill \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/myenv-noAdd2.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{myenv-noAdd2.yaml}}{lst:myenv-noAdd2} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/myenv-noAdd2.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{myenv-noAdd2.yaml}}{lst:myenv-noAdd2} \end{minipage} On applying either of the following commands, @@ -36,11 +36,11 @@ \subsubsection{Environments and their arguments}\label{subsubsec:env-and-their-a we obtain the output given in \cref{lst:myenv-output-4}. \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/myenv-noAdd3.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{myenv-noAdd3.yaml}}{lst:myenv-noAdd3} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/myenv-noAdd3.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{myenv-noAdd3.yaml}}{lst:myenv-noAdd3} \end{minipage} \hfill \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/myenv-noAdd4.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{myenv-noAdd4.yaml}}{lst:myenv-noAdd4} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/myenv-noAdd4.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{myenv-noAdd4.yaml}}{lst:myenv-noAdd4} \end{minipage} \cmhlistingsfromfile{demonstrations/myenvironment-simple-noAdd-body4.tex}{\texttt{myenv.tex output} (using either \cref{lst:myenv-noAdd3} or \cref{lst:myenv-noAdd4})}{lst:myenv-output-4} @@ -59,11 +59,11 @@ \subsubsection{Environments and their arguments}\label{subsubsec:env-and-their-a We may customise \texttt{noAdditionalIndent} for optional and mandatory arguments of the \texttt{myenv} environment, as shown in, for example, \cref{lst:myenv-noAdd5,lst:myenv-noAdd6}. \begin{minipage}{.49\textwidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/myenv-noAdd5.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{myenv-noAdd5.yaml}}{lst:myenv-noAdd5} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/myenv-noAdd5.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{myenv-noAdd5.yaml}}{lst:myenv-noAdd5} \end{minipage} \hfill \begin{minipage}{.49\textwidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/myenv-noAdd6.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{myenv-noAdd6.yaml}}{lst:myenv-noAdd6} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/myenv-noAdd6.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{myenv-noAdd6.yaml}}{lst:myenv-noAdd6} \end{minipage} Upon running @@ -88,11 +88,11 @@ \subsubsection{Environments and their arguments}\label{subsubsec:env-and-their-a \cref{lst:myenv-rules1,lst:myenv-rules2}. \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/myenv-rules1.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{myenv-rules1.yaml}}{lst:myenv-rules1} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/myenv-rules1.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{myenv-rules1.yaml}}{lst:myenv-rules1} \end{minipage} \hfill \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/myenv-rules2.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{myenv-rules2.yaml}}{lst:myenv-rules2} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/myenv-rules2.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{myenv-rules2.yaml}}{lst:myenv-rules2} \end{minipage} On applying either of the following commands, @@ -103,7 +103,7 @@ \subsubsection{Environments and their arguments}\label{subsubsec:env-and-their-a we obtain the output given in \cref{lst:myenv-rules-output}; note in particular that the environment \texttt{myenv} has received one tab (from the \texttt{outer} environment) plus three spaces from \cref{lst:myenv-rules1} or \ref{lst:myenv-rules2}. - \cmhlistingsfromfile{demonstrations/myenv-rules1.tex}{\texttt{myenv.tex output (using either \cref{lst:myenv-rules1} or \cref{lst:myenv-rules2})}}{lst:myenv-rules-output} + \cmhlistingsfromfile[showtabs=true,showspaces=true]{demonstrations/myenv-rules1.tex}{\texttt{myenv.tex output (using either \cref{lst:myenv-rules1} or \cref{lst:myenv-rules2})}}{lst:myenv-rules-output} If you specify a field in \texttt{indentRules} using anything other than horizontal space, it will be ignored. @@ -111,18 +111,18 @@ \subsubsection{Environments and their arguments}\label{subsubsec:env-and-their-a \begin{commandshell} latexindent.pl myenv-args.tex -l=myenv-rules1.yaml \end{commandshell} - we obtain the output in \cref{lst:myenv-args-rules1}; note that the body, optional argument and mandatory argument have \emph{all} - received the same customised indentation. - \cmhlistingsfromfile{demonstrations/myenvironment-args-rules1.tex}{\texttt{myenv-args.tex} using \cref{lst:myenv-rules1}}{lst:myenv-args-rules1} + we obtain the output in \cref{lst:myenv-args-rules1}; note that the body, optional argument and mandatory argument of \texttt{myenv} + have \emph{all} received the same customised indentation. + \cmhlistingsfromfile[showtabs=true,showspaces=true]{demonstrations/myenvironment-args-rules1.tex}{\texttt{myenv-args.tex} using \cref{lst:myenv-rules1}}{lst:myenv-args-rules1} You can specify different indentation rules for the different features using, for example, \cref{lst:myenv-rules3,lst:myenv-rules4} \begin{minipage}{.49\textwidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/myenv-rules3.yaml}[width=.9\linewidth,before=\centering,yaml-TCB]{\texttt{myenv-rules3.yaml}}{lst:myenv-rules3} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/myenv-rules3.yaml}[width=.9\linewidth,before=\centering,yaml-TCB]{\texttt{myenv-rules3.yaml}}{lst:myenv-rules3} \end{minipage} \hfill \begin{minipage}{.49\textwidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/myenv-rules4.yaml}[width=.9\linewidth,before=\centering,yaml-TCB]{\texttt{myenv-rules4.yaml}}{lst:myenv-rules4} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/myenv-rules4.yaml}[width=.9\linewidth,before=\centering,yaml-TCB]{\texttt{myenv-rules4.yaml}}{lst:myenv-rules4} \end{minipage} After running @@ -132,13 +132,15 @@ \subsubsection{Environments and their arguments}\label{subsubsec:env-and-their-a \end{commandshell} then we obtain the respective outputs given in \cref{lst:myenv-args-rules3,lst:myenv-args-rules4}. - \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile{demonstrations/myenvironment-args-rules3.tex}{\texttt{myenv-args.tex} using \cref{lst:myenv-rules3}}{lst:myenv-args-rules3} - \end{minipage} - \hfill - \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile{demonstrations/myenvironment-args-rules4.tex}{\texttt{myenv-args.tex} using \cref{lst:myenv-rules4}}{lst:myenv-args-rules4} - \end{minipage} + \begin{widepage} + \begin{minipage}{.5\textwidth} + \cmhlistingsfromfile[showtabs=true,showspaces=true]{demonstrations/myenvironment-args-rules3.tex}{\texttt{myenv-args.tex} using \cref{lst:myenv-rules3}}{lst:myenv-args-rules3} + \end{minipage}% + \hfill + \begin{minipage}{.5\textwidth} + \cmhlistingsfromfile[showtabs=true,showspaces=true]{demonstrations/myenvironment-args-rules4.tex}{\texttt{myenv-args.tex} using \cref{lst:myenv-rules4}}{lst:myenv-args-rules4} + \end{minipage} + \end{widepage} Note that in \cref{lst:myenv-args-rules3}, the optional argument has only received a single space of indentation, while the mandatory argument has received the default (tab) indentation; the environment body has received three spaces of indentation. @@ -148,7 +150,7 @@ \subsubsection{Environments and their arguments}\label{subsubsec:env-and-their-a \yamltitle{noAdditionalIndentGlobal}*{fields} \begin{wrapfigure}[6]{r}[0pt]{7cm} - \cmhlistingsfromfile[style=noAdditionalIndentGlobalEnv]{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{noAdditionalIndentGlobal}}{lst:noAdditionalIndentGlobal:environments} + \cmhlistingsfromfile[style=noAdditionalIndentGlobalEnv]*{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{noAdditionalIndentGlobal}}{lst:noAdditionalIndentGlobal:environments} \end{wrapfigure} Assuming that your environment name is not found within neither \texttt{noAdditionalIndent} nor \texttt{indentRules}, the next place that \texttt{latexindent.pl} will look is \texttt{noAdditionalIndentGlobal}, and in particular \emph{for the environments} key @@ -179,11 +181,11 @@ \subsubsection{Environments and their arguments}\label{subsubsec:env-and-their-a arguments; on referencing \cref{lst:opt-args-no-add-glob,lst:mand-args-no-add-glob} \begin{minipage}{.49\textwidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/opt-args-no-add-glob.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{opt-args-no-add-glob.yaml}}{lst:opt-args-no-add-glob} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/opt-args-no-add-glob.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{opt-args-no-add-glob.yaml}}{lst:opt-args-no-add-glob} \end{minipage} \hfill \begin{minipage}{.49\textwidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/mand-args-no-add-glob.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{mand-args-no-add-glob.yaml}}{lst:mand-args-no-add-glob} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/mand-args-no-add-glob.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{mand-args-no-add-glob.yaml}}{lst:mand-args-no-add-glob} \end{minipage} we may run the commands @@ -205,7 +207,7 @@ \subsubsection{Environments and their arguments}\label{subsubsec:env-and-their-a \yamltitle{indentRulesGlobal}*{fields} \begin{wrapfigure}[4]{r}[0pt]{7cm} - \cmhlistingsfromfile[style=indentRulesGlobalEnv]{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{indentRulesGlobal}}{lst:indentRulesGlobal:environments} + \cmhlistingsfromfile[style=indentRulesGlobalEnv]*{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{indentRulesGlobal}}{lst:indentRulesGlobal:environments} \end{wrapfigure} The final check that \texttt{latexindent.pl} will make is to look for \texttt{indentRulesGlobal} as detailed in \cref{lst:indentRulesGlobal:environments}; if you change the \texttt{environments} field to anything involving horizontal space, say \lstinline!" "!, and then run the following commands @@ -220,21 +222,21 @@ \subsubsection{Environments and their arguments}\label{subsubsec:env-and-their-a but \texttt{myenv} has received \lstinline!" "!, as specified by the particular \texttt{indentRules} for \texttt{myenv} \vref{lst:myenv-rules1}. \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile{demonstrations/myenvironment-args-global-rules1.tex}{\texttt{myenv-args.tex} using \cref{lst:indentRulesGlobal:environments}}{lst:myenv-args-indent-rules-global1} + \cmhlistingsfromfile[showspaces=true]{demonstrations/myenvironment-args-global-rules1.tex}{\texttt{myenv-args.tex} using \cref{lst:indentRulesGlobal:environments}}{lst:myenv-args-indent-rules-global1} \end{minipage} \hfill \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile{demonstrations/myenvironment-args-global-rules2.tex}{\texttt{myenv-args.tex} using \cref{lst:myenv-rules1,lst:indentRulesGlobal:environments}}{lst:myenv-args-indent-rules-global2} + \cmhlistingsfromfile[showspaces=true]{demonstrations/myenvironment-args-global-rules2.tex}{\texttt{myenv-args.tex} using \cref{lst:myenv-rules1,lst:indentRulesGlobal:environments}}{lst:myenv-args-indent-rules-global2} \end{minipage} You can specify \texttt{indentRulesGlobal} for both optional and mandatory arguments, as detailed in \cref{lst:opt-args-indent-rules-glob,lst:mand-args-indent-rules-glob} \begin{minipage}{.49\textwidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/opt-args-indent-rules-glob.yaml}[width=.9\linewidth,before=\centering,yaml-TCB]{\texttt{opt-args-indent-rules-glob.yaml}}{lst:opt-args-indent-rules-glob} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/opt-args-indent-rules-glob.yaml}[width=.9\linewidth,before=\centering,yaml-TCB]{\texttt{opt-args-indent-rules-glob.yaml}}{lst:opt-args-indent-rules-glob} \end{minipage} \hfill \begin{minipage}{.49\textwidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/mand-args-indent-rules-glob.yaml}[width=.9\linewidth,before=\centering,yaml-TCB]{\texttt{mand-args-indent-rules-glob.yaml}}{lst:mand-args-indent-rules-glob} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/mand-args-indent-rules-glob.yaml}[width=.9\linewidth,before=\centering,yaml-TCB]{\texttt{mand-args-indent-rules-glob.yaml}}{lst:mand-args-indent-rules-glob} \end{minipage} Upon running the following commands @@ -246,10 +248,12 @@ \subsubsection{Environments and their arguments}\label{subsubsec:env-and-their-a argument in \cref{lst:myenv-args-indent-rules-global3} has received two tabs worth of indentation, while the \emph{mandatory} argument has done so in \cref{lst:myenv-args-indent-rules-global4}. - \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile{demonstrations/myenvironment-args-global-rules3.tex}{\texttt{myenv-args.tex} using \cref{lst:opt-args-indent-rules-glob}}{lst:myenv-args-indent-rules-global3} - \end{minipage} - \hfill - \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile{demonstrations/myenvironment-args-global-rules4.tex}{\texttt{myenv-args.tex} using \cref{lst:mand-args-indent-rules-glob}}{lst:myenv-args-indent-rules-global4} - \end{minipage} + \begin{widepage} + \begin{minipage}{.55\textwidth} + \cmhlistingsfromfile[showtabs=true]{demonstrations/myenvironment-args-global-rules3.tex}{\texttt{myenv-args.tex} using \cref{lst:opt-args-indent-rules-glob}}{lst:myenv-args-indent-rules-global3} + \end{minipage} + \hfill + \begin{minipage}{.55\textwidth} + \cmhlistingsfromfile[showtabs=true]{demonstrations/myenvironment-args-global-rules4.tex}{\texttt{myenv-args.tex} using \cref{lst:mand-args-indent-rules-glob}}{lst:myenv-args-indent-rules-global4} + \end{minipage} + \end{widepage} diff --git a/documentation/subsubsec-environments-with-items.tex b/documentation/subsubsec-environments-with-items.tex index 82bcc904..6cdcf48e 100644 --- a/documentation/subsubsec-environments-with-items.tex +++ b/documentation/subsubsec-environments-with-items.tex @@ -12,11 +12,11 @@ \subsubsection{Environments with items} \texttt{indentRules}, as in \cref{lst:item-rules1} \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/item-noAdd1.yaml}[yaml-TCB]{\texttt{item-noAdd1.yaml}}{lst:item-noAdd1} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/item-noAdd1.yaml}[yaml-TCB]{\texttt{item-noAdd1.yaml}}{lst:item-noAdd1} \end{minipage}% \hfill \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/item-rules1.yaml}[yaml-TCB]{\texttt{item-rules1.yaml}}{lst:item-rules1} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/item-rules1.yaml}[yaml-TCB]{\texttt{item-rules1.yaml}}{lst:item-rules1} \end{minipage} Upon running the following commands @@ -33,7 +33,7 @@ \subsubsection{Environments with items} \end{minipage} \hfill \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile{demonstrations/items1-rules1.tex}{\texttt{items1.tex} using \cref{lst:item-rules1}}{lst:items1-rules1} + \cmhlistingsfromfile[showtabs=true,showspaces=true]{demonstrations/items1-rules1.tex}{\texttt{items1.tex} using \cref{lst:item-rules1}}{lst:items1-rules1} \end{minipage} Alternatively, you might like to populate \texttt{noAdditionalIndentGlobal} or \texttt{indentRulesGlobal} using the \texttt{items} @@ -42,11 +42,11 @@ \subsubsection{Environments with items} as the \texttt{item} command is a member of \texttt{indentRules} by default. \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/items-noAdditionalGlobal.yaml}[yaml-TCB]{\texttt{items-noAdditionalGlobal.yaml}}{lst:items-noAdditionalGlobal} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/items-noAdditionalGlobal.yaml}[yaml-TCB]{\texttt{items-noAdditionalGlobal.yaml}}{lst:items-noAdditionalGlobal} \end{minipage}% \hfill \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/items-indentRulesGlobal.yaml}[yaml-TCB]{\texttt{items-indentRulesGlobal.yaml}}{lst:items-indentRulesGlobal} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/items-indentRulesGlobal.yaml}[yaml-TCB]{\texttt{items-indentRulesGlobal.yaml}}{lst:items-indentRulesGlobal} \end{minipage} Upon running the following commands, diff --git a/documentation/subsubsec-headings.tex b/documentation/subsubsec-headings.tex index 7c062666..cc4546c6 100644 --- a/documentation/subsubsec-headings.tex +++ b/documentation/subsubsec-headings.tex @@ -17,7 +17,7 @@ \subsubsection{\texttt{afterHeading} code blocks}\label{subsubsec-headings-no-ad \end{minipage}% \hfill \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/headings3.yaml}[yaml-TCB]{\texttt{headings3.yaml}}{lst:headings3yaml} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/headings3.yaml}[yaml-TCB]{\texttt{headings3.yaml}}{lst:headings3yaml} \end{minipage} If we specify \texttt{noAdditionalIndent} as in \cref{lst:headings4yaml} and run the command @@ -32,7 +32,7 @@ \subsubsection{\texttt{afterHeading} code blocks}\label{subsubsec-headings-no-ad \end{minipage}% \hfill \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/headings4.yaml}[yaml-TCB]{\texttt{headings4.yaml}}{lst:headings4yaml} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/headings4.yaml}[yaml-TCB]{\texttt{headings4.yaml}}{lst:headings4yaml} \end{minipage} Similarly, if we specify \texttt{indentRules} as in \cref{lst:headings5yaml} and run analogous commands to those above, @@ -40,11 +40,11 @@ \subsubsection{\texttt{afterHeading} code blocks}\label{subsubsec-headings-no-ad \emph{after the heading} of \texttt{paragraph} have \emph{all} received three tabs worth of indentation. \begin{minipage}{.55\textwidth} - \cmhlistingsfromfile{demonstrations/headings2-mod5.tex}{\texttt{headings2.tex} using \cref{lst:headings5yaml}}{lst:headings2-mod5} + \cmhlistingsfromfile[showtabs=true]{demonstrations/headings2-mod5.tex}{\texttt{headings2.tex} using \cref{lst:headings5yaml}}{lst:headings2-mod5} \end{minipage}% \hfill \begin{minipage}{.42\textwidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/headings5.yaml}[yaml-TCB]{\texttt{headings5.yaml}}{lst:headings5yaml} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/headings5.yaml}[yaml-TCB]{\texttt{headings5.yaml}}{lst:headings5yaml} \end{minipage} We may, instead, specify \texttt{noAdditionalIndent} in `field' form, as in \cref{lst:headings6yaml} which gives the output in \cref{lst:headings2-mod6}. @@ -54,7 +54,7 @@ \subsubsection{\texttt{afterHeading} code blocks}\label{subsubsec-headings-no-ad \end{minipage}% \hfill \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/headings6.yaml}[yaml-TCB]{\texttt{headings6.yaml}}{lst:headings6yaml} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/headings6.yaml}[yaml-TCB]{\texttt{headings6.yaml}}{lst:headings6yaml} \end{minipage} Analogously, we may specify \texttt{indentRules} as in \cref{lst:headings7yaml} which gives the output in \cref{lst:headings2-mod7}; @@ -62,11 +62,11 @@ \subsubsection{\texttt{afterHeading} code blocks}\label{subsubsec-headings-no-ad received three tabs worth of indentation. \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile{demonstrations/headings2-mod7.tex}{\texttt{headings2.tex} using \cref{lst:headings7yaml}}{lst:headings2-mod7} + \cmhlistingsfromfile[showtabs=true]{demonstrations/headings2-mod7.tex}{\texttt{headings2.tex} using \cref{lst:headings7yaml}}{lst:headings2-mod7} \end{minipage}% \hfill \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/headings7.yaml}[yaml-TCB]{\texttt{headings7.yaml}}{lst:headings7yaml} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/headings7.yaml}[yaml-TCB]{\texttt{headings7.yaml}}{lst:headings7yaml} \end{minipage} Finally, let's consider \texttt{noAdditionalIndentGlobal} and \texttt{indentRulesGlobal} shown in \cref{lst:headings8yaml,lst:headings9yaml} @@ -81,13 +81,13 @@ \subsubsection{\texttt{afterHeading} code blocks}\label{subsubsec-headings-no-ad \end{minipage}% \hfill \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/headings8.yaml}[yaml-TCB]{\texttt{headings8.yaml}}{lst:headings8yaml} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/headings8.yaml}[yaml-TCB]{\texttt{headings8.yaml}}{lst:headings8yaml} \end{minipage} \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile{demonstrations/headings2-mod9.tex}{\texttt{headings2.tex} using \cref{lst:headings9yaml}}{lst:headings2-mod9} + \cmhlistingsfromfile[showspaces=true,showtabs=true]{demonstrations/headings2-mod9.tex}{\texttt{headings2.tex} using \cref{lst:headings9yaml}}{lst:headings2-mod9} \end{minipage}% \hfill \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/headings9.yaml}[yaml-TCB]{\texttt{headings9.yaml}}{lst:headings9yaml} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/headings9.yaml}[yaml-TCB]{\texttt{headings9.yaml}}{lst:headings9yaml} \end{minipage} diff --git a/documentation/subsubsec-ifelsefi.tex b/documentation/subsubsec-ifelsefi.tex index 5c9a37db..0ebb6869 100644 --- a/documentation/subsubsec-ifelsefi.tex +++ b/documentation/subsubsec-ifelsefi.tex @@ -18,11 +18,11 @@ \subsubsection{ifelsefi code blocks} Examples are shown in \cref{lst:ifnum-noAdd,lst:ifnum-indent-rules}. \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/ifnum-noAdd.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{ifnum-noAdd.yaml}}{lst:ifnum-noAdd} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/ifnum-noAdd.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{ifnum-noAdd.yaml}}{lst:ifnum-noAdd} \end{minipage} \hfill \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/ifnum-indent-rules.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{ifnum-indent-rules.yaml}}{lst:ifnum-indent-rules} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/ifnum-indent-rules.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{ifnum-indent-rules.yaml}}{lst:ifnum-indent-rules} \end{minipage} After running the following commands, @@ -39,17 +39,17 @@ \subsubsection{ifelsefi code blocks} \end{minipage} \hfill \begin{minipage}{.5\textwidth} - \cmhlistingsfromfile{demonstrations/ifelsefi1-indent-rules.tex}{\texttt{ifelsefi1.tex} using \cref{lst:ifnum-indent-rules}}{lst:ifelsefi1-output-indent-rules} + \cmhlistingsfromfile[showspaces=true,showtabs=true]{demonstrations/ifelsefi1-indent-rules.tex}{\texttt{ifelsefi1.tex} using \cref{lst:ifnum-indent-rules}}{lst:ifelsefi1-output-indent-rules} \end{minipage} We may specify \texttt{noAdditionalIndentGlobal} and \texttt{indentRulesGlobal} as in \cref{lst:ifelsefi-noAdd-glob,lst:ifelsefi-indent-rules-global}. \begin{minipage}{.49\textwidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/ifelsefi-noAdd-glob.yaml}[width=.9\linewidth,before=\centering,yaml-TCB]{\texttt{ifelsefi-noAdd-glob.yaml}}{lst:ifelsefi-noAdd-glob} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/ifelsefi-noAdd-glob.yaml}[width=.9\linewidth,before=\centering,yaml-TCB]{\texttt{ifelsefi-noAdd-glob.yaml}}{lst:ifelsefi-noAdd-glob} \end{minipage} \hfill \begin{minipage}{.49\textwidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/ifelsefi-indent-rules-global.yaml}[width=.9\linewidth,before=\centering,yaml-TCB]{\texttt{ifelsefi-indent-rules-global.yaml}}{lst:ifelsefi-indent-rules-global} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/ifelsefi-indent-rules-global.yaml}[width=.9\linewidth,before=\centering,yaml-TCB]{\texttt{ifelsefi-indent-rules-global.yaml}}{lst:ifelsefi-indent-rules-global} \end{minipage} Upon running the following commands @@ -66,5 +66,5 @@ \subsubsection{ifelsefi code blocks} \end{minipage} \hfill \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile{demonstrations/ifelsefi1-indent-rules-global.tex}{\texttt{ifelsefi1.tex} using \cref{lst:ifelsefi-indent-rules-global}}{lst:ifelsefi1-output-indent-rules-global} + \cmhlistingsfromfile[showspaces=true]{demonstrations/ifelsefi1-indent-rules-global.tex}{\texttt{ifelsefi1.tex} using \cref{lst:ifelsefi-indent-rules-global}}{lst:ifelsefi1-output-indent-rules-global} \end{minipage} diff --git a/documentation/subsubsec-no-add-remaining-code-blocks.tex b/documentation/subsubsec-no-add-remaining-code-blocks.tex index 7c1302bd..c8caf89b 100644 --- a/documentation/subsubsec-no-add-remaining-code-blocks.tex +++ b/documentation/subsubsec-no-add-remaining-code-blocks.tex @@ -22,7 +22,7 @@ \subsubsection{The remaining code blocks} \end{minipage}% \hfill \begin{minipage}{.5\textwidth} - \cmhlistingsfromfile{demonstrations/pgfkeys1-default.tex}{\texttt{pgfkeys1.tex} default output}{lst:pgfkeys1:default} + \cmhlistingsfromfile[showtabs=true]{demonstrations/pgfkeys1-default.tex}{\texttt{pgfkeys1.tex} default output}{lst:pgfkeys1:default} \end{minipage}% In \cref{lst:pgfkeys1:default}, note that the maximum indentation is three tabs, and these come from: @@ -48,7 +48,7 @@ \subsubsection{The remaining code blocks} \end{minipage}% \hfill \begin{minipage}{.5\textwidth} - \cmhlistingsfromfile{demonstrations/child1-default.tex}{\texttt{child1.tex} default output}{lst:child1:default} + \cmhlistingsfromfile[showtabs=true]{demonstrations/child1-default.tex}{\texttt{child1.tex} default output}{lst:child1:default} \end{minipage}% In particular, \texttt{latexindent.pl} considers \texttt{child}, \texttt{parent} and \texttt{node} all to be \texttt{namedGroupingBracesBrackets}\footnote{ @@ -77,7 +77,7 @@ \subsubsection{The remaining code blocks} \end{minipage}% \hfill \begin{minipage}{.5\textwidth} - \cmhlistingsfromfile{demonstrations/psforeach1-default.tex}{\texttt{psforeach1.tex} default output}{lst:psforeach:default} + \cmhlistingsfromfile[showtabs=true]{demonstrations/psforeach1-default.tex}{\texttt{psforeach1.tex} default output}{lst:psforeach:default} \end{minipage}% Referencing \cref{lst:psforeach:default}, there are \emph{three} sets of unnamed braces. Note also that the maximum value @@ -100,10 +100,10 @@ \subsubsection{Summary} \begin{widepage} \begin{minipage}{.47\linewidth} - \cmhlistingsfromfile[style=noAdditionalIndentGlobal]{../defaultSettings.yaml}[before=\centering,yaml-TCB]{\texttt{noAdditionalIndentGlobal}}{lst:noAdditionalIndentGlobal} + \cmhlistingsfromfile[style=noAdditionalIndentGlobal]*{../defaultSettings.yaml}[before=\centering,yaml-TCB]{\texttt{noAdditionalIndentGlobal}}{lst:noAdditionalIndentGlobal} \end{minipage}% \hfill \begin{minipage}{.47\linewidth} - \cmhlistingsfromfile[style=indentRulesGlobal]{../defaultSettings.yaml}[before=\centering,yaml-TCB]{\texttt{indentRulesGlobal}}{lst:indentRulesGlobal} + \cmhlistingsfromfile[style=indentRulesGlobal]*{../defaultSettings.yaml}[before=\centering,yaml-TCB]{\texttt{indentRulesGlobal}}{lst:indentRulesGlobal} \end{minipage}% \end{widepage} diff --git a/documentation/subsubsec-special.tex b/documentation/subsubsec-special.tex index 8deca581..d6d0c35d 100644 --- a/documentation/subsubsec-special.tex +++ b/documentation/subsubsec-special.tex @@ -8,11 +8,11 @@ \subsubsection{\texttt{specialBeginEnd} code blocks} Examples are shown in \cref{lst:displayMath-noAdd,lst:displayMath-indent-rules}. \begin{minipage}{.49\textwidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/displayMath-noAdd.yaml}[width=.9\linewidth,before=\centering,yaml-TCB]{\texttt{displayMath-noAdd.yaml}}{lst:displayMath-noAdd} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/displayMath-noAdd.yaml}[width=.9\linewidth,before=\centering,yaml-TCB]{\texttt{displayMath-noAdd.yaml}}{lst:displayMath-noAdd} \end{minipage} \hfill \begin{minipage}{.49\textwidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/displayMath-indent-rules.yaml}[width=.9\linewidth,before=\centering,yaml-TCB]{\texttt{displayMath-indent-rules.yaml}}{lst:displayMath-indent-rules} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/displayMath-indent-rules.yaml}[width=.9\linewidth,before=\centering,yaml-TCB]{\texttt{displayMath-indent-rules.yaml}}{lst:displayMath-indent-rules} \end{minipage} After running the following commands, @@ -29,17 +29,17 @@ \subsubsection{\texttt{specialBeginEnd} code blocks} \end{minipage} \hfill \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile{demonstrations/special1-indent-rules.tex}{\texttt{special1.tex} using \cref{lst:displayMath-indent-rules}}{lst:special1-output-indent-rules} + \cmhlistingsfromfile[showtabs=true]{demonstrations/special1-indent-rules.tex}{\texttt{special1.tex} using \cref{lst:displayMath-indent-rules}}{lst:special1-output-indent-rules} \end{minipage} We may specify \texttt{noAdditionalIndentGlobal} and \texttt{indentRulesGlobal} as in \cref{lst:special-noAdd-glob,lst:special-indent-rules-global}. \begin{minipage}{.49\textwidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/special-noAdd-glob.yaml}[width=.9\linewidth,before=\centering,yaml-TCB]{\texttt{special-noAdd-glob.yaml}}{lst:special-noAdd-glob} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/special-noAdd-glob.yaml}[width=.9\linewidth,before=\centering,yaml-TCB]{\texttt{special-noAdd-glob.yaml}}{lst:special-noAdd-glob} \end{minipage} \hfill \begin{minipage}{.49\textwidth} - \cmhlistingsfromfile[style=yaml-LST]{demonstrations/special-indent-rules-global.yaml}[width=.9\linewidth,before=\centering,yaml-TCB]{\texttt{special-indent-rules-global.yaml}}{lst:special-indent-rules-global} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/special-indent-rules-global.yaml}[width=.9\linewidth,before=\centering,yaml-TCB]{\texttt{special-indent-rules-global.yaml}}{lst:special-indent-rules-global} \end{minipage} Upon running the following commands @@ -56,5 +56,5 @@ \subsubsection{\texttt{specialBeginEnd} code blocks} \end{minipage} \hfill \begin{minipage}{.45\textwidth} - \cmhlistingsfromfile{demonstrations/special1-indent-rules-global.tex}{\texttt{special1.tex} using \cref{lst:special-indent-rules-global}}{lst:special1-output-indent-rules-global} + \cmhlistingsfromfile[showspaces=true]{demonstrations/special1-indent-rules-global.tex}{\texttt{special1.tex} using \cref{lst:special-indent-rules-global}}{lst:special1-output-indent-rules-global} \end{minipage} diff --git a/documentation/title.tex b/documentation/title.tex index 74450037..5cbe1f3c 100644 --- a/documentation/title.tex +++ b/documentation/title.tex @@ -8,24 +8,19 @@ sharp corners, enhanced, overlay={\node[anchor=north east,outer sep=2pt] at ([xshift=3cm,yshift=4mm]frame.north east) {\includegraphics[width=3cm]{logo}}; }] - \centering\ttfamily\bfseries latexindent.pl\\[1cm] Version 3.3 + \centering\ttfamily\bfseries latexindent.pl\\[1cm] Version 3.4 \end{tcolorbox} } -\author{Chris Hughes \thanks{and contributors! See \vref{sec:contributors}. For +\author{Chris Hughes \thanks{and contributors! + See \vref{sec:contributors}. + For all communication, please visit \cite{latexindent-home}.}} \maketitle \begin{adjustwidth}{1cm}{1cm} \small - \texttt{latexindent.pl} is a \texttt{Perl} script that indents \texttt{.tex} (and other) - files according to an indentation scheme that the user can modify to suit their - taste. Environments, including those with alignment delimiters (such as \texttt{tabular}), - and commands, including those that can split braces and brackets across lines, - are \emph{usually} handled correctly by the script. Options for \texttt{verbatim}-like - environments and commands, together with indentation after headings (such as \lstinline!chapter!, \lstinline!section!, etc) - are also available. The script also has the ability to modifiy line breaks, and add - comment symbols. All user options are customisable via the switches in the YAML interface. + \texttt{latexindent.pl} is a \texttt{Perl} script that indents \texttt{.tex} (and other) files according to an indentation scheme that the user can modify to suit their taste. + Environments, including those with alignment delimiters (such as \texttt{tabular}), and commands, including those that can split braces and brackets across lines, are \emph{usually} handled correctly by the script. + Options for \texttt{verbatim}-like environments and commands, together with indentation after headings (such as \lstinline!chapter!, \lstinline!section!, etc) are also available. + The script also has the ability to modifiy line breaks, and add comment symbols. + All user options are customisable via the switches in the YAML interface; you can find a quick start guide in \vref{sec:quickstart}. \end{adjustwidth} -\tableofcontents -{\small - \lstlistoflistings -} diff --git a/helper-scripts/copy-to-usb.sh b/helper-scripts/copy-to-usb.sh index 6f7b9bba..b0f5c40d 100755 --- a/helper-scripts/copy-to-usb.sh +++ b/helper-scripts/copy-to-usb.sh @@ -1,11 +1,12 @@ #!/bin/bash -destinationDir="/media/D8B4-3FFC/latexindent/" +destinationDir="/media/cmhughes/D8B4-3FFC/latexindent/" # from this directory cp create-windows-executable.bat ${destinationDir} cp test-windows-small.bat ${destinationDir} cp ppp.pl ${destinationDir} +cp latexindent-module-installer.pl ${destinationDir} # from the one above cd ../ diff --git a/helper-scripts/documentation-default-settings-update.pl b/helper-scripts/documentation-default-settings-update.pl index 6467bd00..3996f893 100755 --- a/helper-scripts/documentation-default-settings-update.pl +++ b/helper-scripts/documentation-default-settings-update.pl @@ -7,7 +7,7 @@ # store the names of each field my @namesAndOffsets = ( {name=>"fileExtensionPreference",numberOfLines=>4}, - {name=>"logFilePreferences",numberOfLines=>4}, + {name=>"logFilePreferences",numberOfLines=>10}, {name=>"verbatimEnvironments",numberOfLines=>3}, {name=>"verbatimCommands",numberOfLines=>2}, {name=>"noIndentBlock",numberOfLines=>2}, @@ -28,6 +28,10 @@ {name=>"textWrapOptionsAll",numberOfLines=>2,special=>"textWrapOptions"}, {name=>"removeParagraphLineBreaks",numberOfLines=>12}, {name=>"paragraphsStopAt",numberOfLines=>8}, + {name=>"oneSentencePerLine",numberOfLines=>21}, + {name=>"sentencesFollow",numberOfLines=>8}, + {name=>"sentencesBeginWith",numberOfLines=>3}, + {name=>"sentencesEndWith",numberOfLines=>5}, {name=>"modifylinebreaksEnv",numberOfLines=>9,special=>"environments"}, ); diff --git a/helper-scripts/latexindent-module-installer.pl b/helper-scripts/latexindent-module-installer.pl new file mode 100755 index 00000000..660b81d2 --- /dev/null +++ b/helper-scripts/latexindent-module-installer.pl @@ -0,0 +1,51 @@ +#!/usr/bin/env perl +# latexindent.pl, version 3.3, 2017-08-21 +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# See http://www.gnu.org/licenses/. +# +# Chris Hughes, 2017 +# +# For all communication, please visit: https://github.com/cmhughes/latexindent.pl + +use strict; +use warnings; + +print ("============\nlatexindent.pl module installer\n============\n"); +print ("Would you like to run the following commands?\n"); +my @modulesToInstall = ("cpanm YAML::Tiny","cpanm File::HomeDir","cpanm Unicode::GCString","cpanm Log::Log4perl","cpanm Log::Dispatch"); +foreach (@modulesToInstall) { + print $_,"\n"; +} +if (prompt_yn("Press Y to run the above commands")){ + foreach (@modulesToInstall) { + system($_); + } +} else { + print "Not installing modules\n"; +} +exit; + +# reference: https://stackoverflow.com/questions/18103501/prompting-multiple-questions-to-user-yes-no-file-name-input +sub prompt { + my ($query) = @_; # take a prompt string as argument + local $| = 1; # activate autoflush to immediately show the prompt + print $query; + chomp(my $answer = <STDIN>); + return $answer; +} + +sub prompt_yn { + my ($query) = @_; + my $answer = prompt("$query (Y/N): "); + return lc($answer) eq 'y'; +} diff --git a/helper-scripts/prepctan.sh b/helper-scripts/prepctan.sh index c246d5a2..61368bd2 100755 --- a/helper-scripts/prepctan.sh +++ b/helper-scripts/prepctan.sh @@ -6,13 +6,15 @@ git checkout master # re-compile the documentation cd ../documentation arara latexindent -egrep 'undefined' latexindent.log -egrep 'multiply-defined' latexindent.log +egrep -i --color=auto 'undefined' latexindent.log && read -p "Does the above look ok?" +egrep -i --color=auto 'multiply-defined' latexindent.log && read -p "Does the above look ok?" +egrep -i --color=auto 'fixthis' latexindent.log && read -p "Does the above look ok?" nohup evince latexindent.pdf cd ../ # create a folder mkdir latexindent cp latexindent.pl latexindent +cp helper-scripts/latexindent-module-installer.pl latexindent cp latexindent.exe latexindent cp defaultSettings.yaml latexindent # modules diff --git a/helper-scripts/update-version.sh b/helper-scripts/update-version.sh index 54696492..80b6927f 100755 --- a/helper-scripts/update-version.sh +++ b/helper-scripts/update-version.sh @@ -15,10 +15,10 @@ do esac done -oldVersion='3.2.2' -newVersion='3.3' -oldDate='2017-06-28' -newDate='2017-08-21' +oldVersion='3.3' +newVersion='3.4' +oldDate='2017-08-21' +newDate='2018-01-13' cd ../ cd documentation diff --git a/latexindent.exe b/latexindent.exe index 1a41007f..3c3714c8 100755 Binary files a/latexindent.exe and b/latexindent.exe differ diff --git a/latexindent.pl b/latexindent.pl index b2d9da3a..3b943817 100755 --- a/latexindent.pl +++ b/latexindent.pl @@ -1,5 +1,5 @@ #!/usr/bin/env perl -# latexindent.pl, version 3.3, 2017-08-21 +# latexindent.pl, version 3.4, 2018-01-13 # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -43,6 +43,7 @@ "logfile|g=s"=>\$switches{logFileName}, "help|h"=>\$switches{showhelp}, "cruft|c=s"=>\$switches{cruftDirectory}, + "screenlog|sl"=>\$switches{screenlog}, ); # check local settings doesn't interfer with reading the file; @@ -69,6 +70,9 @@ $switches{readLocalSettings} = 'localSettings.yaml'; } -my $document = LatexIndent::Document->new(name=>"masterDocument",fileName=>$ARGV[0],switches=>\%switches); +# allow STDIN as input, if a filename is not present +unshift( @ARGV, '-' ) unless @ARGV; + +my $document = bless ({name=>"masterDocument",fileName=>$ARGV[0],switches=>\%switches},"LatexIndent::Document"); $document->latexindent; exit(0); diff --git a/readme.md b/readme.md index ae8c95e4..d9445a35 100644 --- a/readme.md +++ b/readme.md @@ -1,15 +1,22 @@ -`PERL` script to indent code within environments, and align delimited -environments in `.tex`files. +### introduction - latexindent.pl, version 3.3, 2017-08-21 +`latexindent.pl` is a `perl` script to indent (add horizontal leading space to) +code within environments, commands, after headings and within special code blocks. -Author: Chris Hughes (cmhughes) +It has the ability to align delimiters in environments and commands, and +can modify line breaks. ---- + latexindent.pl, version 3.4, 2018-01-13 + +### author +Chris Hughes (cmhughes) + +### documentation For complete details, please see http://mirrors.ctan.org/support/latexindent/documentation/latexindent.pdf -Note: `latexindent.exe` was created using +### Windows executable +`latexindent.exe` is created using perl ppp.pl -u -o latexindent.exe latexindent.pl @@ -17,8 +24,6 @@ using the `Par::Packer` perl module. `ppp.pl` is located in the helper-scripts directory. ---- - ### usage You'll need @@ -36,7 +41,7 @@ directory, and then run the command (on Linux/Mac -- sorry, a Windows test-case ./test-cases.sh -## *important* +### *important* This script may not work for your style of formatting; I highly recommend comparing the outputfile.tex to make sure that @@ -67,10 +72,14 @@ which means that latexindent.pl always has two branches: The `master` branch always contains the released version and `develop` contains the development version. When developing a new feature or bug fix, I typically use: + git checkout develop git checkout -b feature/name-of-feature -and then I merge it into the `develop` branch. +and then I merge it into the `develop` branch using + + git checkout develop + git merge feature/name-of-feature --no-ff ### perl version -I develop latexindent.pl on Ubuntu Linux, using perlbrew; I currently develop on perl version v5.22.1 +I develop latexindent.pl on Ubuntu Linux, using perlbrew; I currently develop on perl version v5.26.0 diff --git a/test-cases/STDIN/myfile-default.tex b/test-cases/STDIN/myfile-default.tex new file mode 100644 index 00000000..922e43e4 --- /dev/null +++ b/test-cases/STDIN/myfile-default.tex @@ -0,0 +1,3 @@ +\mycommand{one + two + three} diff --git a/test-cases/STDIN/myfile.tex b/test-cases/STDIN/myfile.tex new file mode 100644 index 00000000..e64c7664 --- /dev/null +++ b/test-cases/STDIN/myfile.tex @@ -0,0 +1,3 @@ +\mycommand{one +two +three} diff --git a/test-cases/STDIN/stdin-test-cases.sh b/test-cases/STDIN/stdin-test-cases.sh new file mode 100755 index 00000000..4eb18212 --- /dev/null +++ b/test-cases/STDIN/stdin-test-cases.sh @@ -0,0 +1,7 @@ +#!/bin/bash +loopmax=0 +. ../common.sh + +[[ $silentMode == 0 ]] && set -x +cat myfile.tex | latexindent.pl -s -o=myfile-default +git status diff --git a/test-cases/alignment/align-no-double-back-slash.yaml b/test-cases/alignment/align-no-double-back-slash.yaml index 9c9302a2..b7945eb1 100644 --- a/test-cases/alignment/align-no-double-back-slash.yaml +++ b/test-cases/alignment/align-no-double-back-slash.yaml @@ -1,3 +1,4 @@ lookForAlignDelims: align*: alignDoubleBackSlash: 0 + spacesBeforeDoubleBackSlash: 0 diff --git a/test-cases/alignment/alignment-test-cases.sh b/test-cases/alignment/alignment-test-cases.sh index 1b6d976a..503f4bb9 100755 --- a/test-cases/alignment/alignment-test-cases.sh +++ b/test-cases/alignment/alignment-test-cases.sh @@ -9,11 +9,11 @@ latexindent.pl -s table1.tex -o table1-default.tex for (( i=$loopmin ; i <= $loopmax ; i++ )) do # basic tests - latexindent.pl -s table1.tex -o table1-mod$i.tex -l=tabular$i.yaml,multiColumnGrouping2.yaml - latexindent.pl -s table2.tex -o table2-mod$i.tex -l=tabular$i.yaml - latexindent.pl -s table3.tex -o table3-mod$i.tex -l=tabular$i.yaml - latexindent.pl -s table4.tex -o table4-mod$i.tex -l=tabular$i.yaml - latexindent.pl -s table5.tex -o table5-mod$i.tex -l=tabular$i.yaml + latexindent.pl -s table1.tex -o=+-mod$i.tex -l=tabular$i.yaml,multiColumnGrouping2.yaml + latexindent.pl -s table2.tex -o=+-mod$i.tex -l=tabular$i.yaml + latexindent.pl -s table3.tex -o=+-mod$i.tex -l=tabular$i.yaml + latexindent.pl -s table4.tex -o=+-mod$i.tex -l=tabular$i.yaml + latexindent.pl -s table5.tex -o=+-mod$i.tex -l=tabular$i.yaml # tests with \\ not aligned latexindent.pl -s table1.tex -o table1-mod$((i+4)).tex -l=tabular$i.yaml,tabular5.yaml,multiColumnGrouping2.yaml latexindent.pl -s table2.tex -o table2-mod$((i+4)).tex -l=tabular$i.yaml,tabular5.yaml @@ -21,61 +21,79 @@ do latexindent.pl -s table1.tex -o table1-mod$((i+8)).tex -l=tabular$i.yaml,tabular6.yaml,multiColumnGrouping2.yaml latexindent.pl -s table2.tex -o table2-mod$((i+8)).tex -l=tabular$i.yaml,tabular6.yaml # alignment inside commented block - latexindent.pl -s alignmentoutsideEnvironmentsCommands.tex -o alignmentoutsideEnvironmentsCommands-mod$i.tex -l tabular$i.yaml - latexindent.pl -s alignmentoutsideEnvironmentsCommands.tex -o alignmentoutsideEnvironmentsCommands-no-Add-1-mod$i.tex -l tabular$i.yaml,noAddtabular1.yaml - latexindent.pl -s alignmentoutsideEnvironmentsCommands.tex -o alignmentoutsideEnvironmentsCommands-no-Add-2-mod$i.tex -l tabular$i.yaml,noAddtabular2.yaml - latexindent.pl -s alignmentoutsideEnvironmentsCommands.tex -o alignmentoutsideEnvironmentsCommands-no-Add-3-mod$i.tex -l tabular$i.yaml,noAddtabular3.yaml - latexindent.pl -s alignmentoutsideEnvironmentsCommands.tex -o alignmentoutsideEnvironmentsCommands-indent-rules-1-mod$i.tex -l tabular$i.yaml,indentRules1.yaml - latexindent.pl -s alignmentoutsideEnvironmentsCommands.tex -o alignmentoutsideEnvironmentsCommands-indent-rules-2-mod$i.tex -l tabular$i.yaml,indentRules2.yaml - latexindent.pl -s alignmentoutsideEnvironmentsCommands.tex -o alignmentoutsideEnvironmentsCommands-indent-rules-3-mod$i.tex -l tabular$i.yaml,indentRules3.yaml + latexindent.pl -s alignmentoutsideEnvironmentsCommands.tex -o=+-mod$i.tex -l tabular$i.yaml + latexindent.pl -s alignmentoutsideEnvironmentsCommands.tex -o=+-no-Add-1-mod$i.tex -l tabular$i.yaml,noAddtabular1.yaml + latexindent.pl -s alignmentoutsideEnvironmentsCommands.tex -o=+-no-Add-2-mod$i.tex -l tabular$i.yaml,noAddtabular2.yaml + latexindent.pl -s alignmentoutsideEnvironmentsCommands.tex -o=+-no-Add-3-mod$i.tex -l tabular$i.yaml,noAddtabular3.yaml + latexindent.pl -s alignmentoutsideEnvironmentsCommands.tex -o=+-indent-rules-1-mod$i.tex -l tabular$i.yaml,indentRules1.yaml + latexindent.pl -s alignmentoutsideEnvironmentsCommands.tex -o=+-indent-rules-2-mod$i.tex -l tabular$i.yaml,indentRules2.yaml + latexindent.pl -s alignmentoutsideEnvironmentsCommands.tex -o=+-indent-rules-3-mod$i.tex -l tabular$i.yaml,indentRules3.yaml done -latexindent.pl -s table1.tex -o table1-mod3.tex -l=tabular3.yaml +latexindent.pl -s table1.tex -o=+-mod3.tex -l=tabular3.yaml # legacy matrix test case -latexindent.pl -s matrix.tex -o matrix-default.tex +latexindent.pl -s matrix.tex -o=+-default.tex # legacy environment test case -latexindent.pl -s environments.tex -o environments-default.tex -latexindent.pl -s environments.tex -o environments-no-align-double-back-slash.tex -l=align-no-double-back-slash.yaml -latexindent.pl -s legacy-align.tex -o legacy-align-default.tex +latexindent.pl -s environments.tex -o=+-default.tex +latexindent.pl -s environments.tex -o=+-no-align-double-back-slash.tex -l=align-no-double-back-slash.yaml +latexindent.pl -s legacy-align.tex -o=+-default.tex # alignment inside a mandatory argument -latexindent.pl -s matrix1.tex -o matrix1-default.tex -latexindent.pl -s matrix1.tex -o matrix1-no-align.tex -l=noMatrixAlign.yaml +latexindent.pl -s matrix1.tex -o=+-default.tex +latexindent.pl -s matrix1.tex -o=+-no-align.tex -l=noMatrixAlign.yaml # nested -latexindent.pl nested-align1.tex -s -l=indentPreamble.yaml -m -o nested-align1-mod0.tex +latexindent.pl nested-align1.tex -s -l=indentPreamble.yaml -m -o=+-mod0.tex # using comments -latexindent.pl -s alignmentoutsideEnvironmentsCommands.tex -o alignmentoutsideEnvironmentsCommands-default.tex +latexindent.pl -s alignmentoutsideEnvironmentsCommands.tex -o=+-default.tex # end statement not on own line -latexindent.pl -s end-not-on-own-line.tex -o end-not-on-own-line-default.tex -latexindent.pl -s end-not-on-own-line1.tex -o end-not-on-own-line1-default.tex -latexindent.pl -s end-not-on-own-line1.tex -o end-not-on-own-line1-mod1.tex -m -l=env-mod-lines1.yaml +latexindent.pl -s end-not-on-own-line.tex -o=+-default.tex +latexindent.pl -s end-not-on-own-line1.tex -o=+-default.tex +latexindent.pl -s end-not-on-own-line1.tex -o=+-mod1.tex -m -l=env-mod-lines1.yaml # pmatrix latexindent.pl -s pmatrix.tex -outputfile=pmatrix-default.tex -l=noRoundParenthesisInArgs.yaml -latexindent.pl -s pmatrix.tex -o pmatrix-special-mod1.tex -m -l=../specials/special-mod1.yaml,noRoundParenthesisInArgs.yaml -latexindent.pl -s pmatrix.tex -o pmatrix-pmatrix-mod1.tex -m -l=pmatrix-mod1.yaml,noRoundParenthesisInArgs.yaml -latexindent.pl -s pmatrix.tex -o pmatrix-pmatrix-special-mod1.tex -m -l=pmatrix-mod1.yaml,../specials/special-mod1.yaml,noRoundParenthesisInArgs.yaml +latexindent.pl -s pmatrix.tex -o=+-special-mod1.tex -m -l=../specials/special-mod1.yaml,noRoundParenthesisInArgs.yaml +latexindent.pl -s pmatrix.tex -o=+-pmatrix-mod1.tex -m -l=pmatrix-mod1.yaml,noRoundParenthesisInArgs.yaml +latexindent.pl -s pmatrix.tex -o=+-pmatrix-special-mod1.tex -m -l=pmatrix-mod1.yaml,../specials/special-mod1.yaml,noRoundParenthesisInArgs.yaml # special -latexindent.pl -s special1.tex -o special1-aligned.tex -l special-align.yaml +latexindent.pl -s special1.tex -o=+-aligned.tex -l special-align.yaml # uni code for (( i=1 ; i <= 6 ; i++ )) do - latexindent.pl -s uni-code1.tex -o uni-code1-mod$i.tex -l=tabular$i.yaml + latexindent.pl -s uni-code1.tex -o=+-mod$i.tex -l=tabular$i.yaml done # multiColumnGrouping -latexindent.pl -s tabular-karl.tex -o tabular-karl-default.tex -latexindent.pl -s tabular-karl.tex -o tabular-karl-out.tex -l multiColumnGrouping.yaml -latexindent.pl -s tabular-karl.tex -o tabular-karl-out1.tex -l multiColumnGrouping1.yaml -latexindent.pl -s tabular-karl.tex -o tabular-karl-out2.tex -l multiColumnGrouping2.yaml -latexindent.pl -s tabular-karl.tex -o tabular-karl-out3.tex -l multiColumnGrouping3.yaml -latexindent.pl -s tabular-karl.tex -o tabular-karl-out5.tex -l multiColumnGrouping.yaml,tabular5.yaml -latexindent.pl -s tabular-karl.tex -o tabular-karl-out6.tex -l multiColumnGrouping.yaml,tabular6.yaml -latexindent.pl -s multicol.tex -o multicol-out.tex -l multiColumnGrouping.yaml -latexindent.pl -s unicode-multicol.tex -o unicode-multicol-out.tex -l multiColumnGrouping.yaml -latexindent.pl -s table3.tex -o table3-out.tex -l multiColumnGrouping.yaml -latexindent.pl -s multicol-no-ampersands -o multicol-no-ampersands-default.tex -latexindent.pl -s multicol-no-ampersands.tex -o multicol-no-ampersands-out.tex -l multiColumnGrouping.yaml -latexindent.pl -s multicol-no-ampersands.tex -o multicol-no-ampersands-out5.tex -l multiColumnGrouping.yaml,tabular5.yaml -latexindent.pl -s multicol-no-ampersands.tex -o multicol-no-ampersands-out6.tex -l multiColumnGrouping.yaml,tabular6.yaml -latexindent.pl -s longcells.tex -o longcells-default.tex -latexindent.pl -s longcells.tex -o longcells-multicol.tex -l multiColumnGrouping.yaml +latexindent.pl -s tabular-karl.tex -o=+-default.tex +latexindent.pl -s tabular-karl.tex -o=+-out.tex -l multiColumnGrouping.yaml +latexindent.pl -s tabular-karl.tex -o=+-out1.tex -l multiColumnGrouping1.yaml +latexindent.pl -s tabular-karl.tex -o=+-out2.tex -l multiColumnGrouping2.yaml +latexindent.pl -s tabular-karl.tex -o=+-out3.tex -l multiColumnGrouping3.yaml +latexindent.pl -s tabular-karl.tex -o=+-out5.tex -l multiColumnGrouping.yaml,tabular5.yaml +latexindent.pl -s tabular-karl.tex -o=+-out6.tex -l multiColumnGrouping.yaml,tabular6.yaml +latexindent.pl -s multicol.tex -o=+-out.tex -l multiColumnGrouping.yaml +latexindent.pl -s unicode-multicol.tex -o=+-out.tex -l multiColumnGrouping.yaml +latexindent.pl -s table3.tex -o=+-out.tex -l multiColumnGrouping.yaml +latexindent.pl -s multicol-no-ampersands -o=+-default.tex +latexindent.pl -s multicol-no-ampersands.tex -o=+-out.tex -l multiColumnGrouping.yaml +latexindent.pl -s multicol-no-ampersands.tex -o=+-out5.tex -l multiColumnGrouping.yaml,tabular5.yaml +latexindent.pl -s multicol-no-ampersands.tex -o=+-out6.tex -l multiColumnGrouping.yaml,tabular6.yaml +latexindent.pl -s longcells.tex -o=+-default.tex +latexindent.pl -s longcells.tex -o=+-multicol.tex -l multiColumnGrouping.yaml +# spaces before and after ampersands +latexindent.pl -s table5.tex -o=+-mod7 -l=tabular7 +latexindent.pl -s table5.tex -o=+-mod8 -l=tabular8 +latexindent.pl -s table5.tex -o=+-mod9 -l=tabular9 +latexindent.pl -s table5.tex -o=+-mod10 -l=tabular10 +latexindent.pl -s tabular-karl.tex -o=+-out9.tex -l multiColumnGrouping.yaml,tabular9.yaml +latexindent.pl -s tabular-karl.tex -o=+-out10.tex -l multiColumnGrouping.yaml,tabular10.yaml +latexindent.pl -s matrix1.tex -o=+-mod1 -l=matrix1 +latexindent.pl -s matrix1.tex -o=+-mod2 -l=matrix2 +# left/right justification +latexindent.pl -s table5.tex -o=+-mod11 -l=tabular11 +latexindent.pl -s table5.tex -o=+-mod12 -l=tabular11,tabular7,tabular8 +latexindent.pl -s table5.tex -o=+-mod13 -l=tabular11,tabular9 +latexindent.pl -s tabular-karl.tex -o=+-out11.tex -l multiColumnGrouping.yaml,tabular11.yaml +# issue 95 demo +latexindent.pl -s issue-95 -o=+-mod0 +latexindent.pl -s issue-95 -o=+-mod1 -l=noMaxDelims.yaml + [[ $silentMode == 0 ]] && set -x git status [[ $noisyMode == 1 ]] && makenoise diff --git a/test-cases/alignment/issue-95-mod0.tex b/test-cases/alignment/issue-95-mod0.tex new file mode 100644 index 00000000..dc054475 --- /dev/null +++ b/test-cases/alignment/issue-95-mod0.tex @@ -0,0 +1,20 @@ + + +%% cv results +\begin{table}[b!] +\centering +\caption[]{Repetition mean \ac{AUROC} values (bold) and runtime (minutes) for each model and \ac{CV} setting for 200 random search iterations.} +\begingroup\footnotesize +\begin{tabular}{lllll} + \\ + & \specialcell{Non-Spatial/Non-Spatial \\ {(nsp/nsp)}} & \specialcell{Spatial/Non-Spatial \\ {(\emph{sp/nsp})}} & \specialcell{Spatial/Spatial \\ {(\emph{sp/sp})}} & \specialcell{Spatial/No Tuning \\ {(\emph{sp/not})}} \\ + \hline + \ac{SVM} & \textbf{0.906}, 134.30 & \textbf{0.858}, 152.16 & \textbf{0.844}, 128.10 & \textbf{0.814}, 0.31 \\ + \ac{RF} & \textbf{0.945}, 1697.41 & \textbf{0.872}, 1651.95 & \textbf{0.863}, 1594.90 & \textbf{0.872}, 0.28 \\ + \ac{BRT} & \textbf{0.949}, 2923.66 & \textbf{0.873}, 2905.61 & \textbf{0.859}, 2895.17 & \textbf{0.771}, 0.20 \\ + \ac{WKNN} & \textbf{0.895}, 86.67 & \textbf{0.839}, 113.21 & \textbf{0.839}, 81.66 & \textbf{0.841}, 0.22 \\ + \bottomrule +\end{tabular} +\endgroup +\label{tab:cv_results} +\end{table} diff --git a/test-cases/alignment/issue-95-mod1.tex b/test-cases/alignment/issue-95-mod1.tex new file mode 100644 index 00000000..2749e41a --- /dev/null +++ b/test-cases/alignment/issue-95-mod1.tex @@ -0,0 +1,20 @@ + + +%% cv results +\begin{table}[b!] +\centering +\caption[]{Repetition mean \ac{AUROC} values (bold) and runtime (minutes) for each model and \ac{CV} setting for 200 random search iterations.} +\begingroup\footnotesize +\begin{tabular}{lllll} + \\ + & \specialcell{Non-Spatial/Non-Spatial \\ {(nsp/nsp)}} & \specialcell{Spatial/Non-Spatial \\ {(\emph{sp/nsp})}} & \specialcell{Spatial/Spatial \\ {(\emph{sp/sp})}} & \specialcell{Spatial/No Tuning \\ {(\emph{sp/not})}} \\ + \hline + \ac{SVM} & \textbf{0.906}, 134.30 & \textbf{0.858}, 152.16 & \textbf{0.844}, 128.10 & \textbf{0.814}, 0.31 \\ + \ac{RF} & \textbf{0.945}, 1697.41 & \textbf{0.872}, 1651.95 & \textbf{0.863}, 1594.90 & \textbf{0.872}, 0.28 \\ + \ac{BRT} & \textbf{0.949}, 2923.66 & \textbf{0.873}, 2905.61 & \textbf{0.859}, 2895.17 & \textbf{0.771}, 0.20 \\ + \ac{WKNN} & \textbf{0.895}, 86.67 & \textbf{0.839}, 113.21 & \textbf{0.839}, 81.66 & \textbf{0.841}, 0.22 \\ + \bottomrule +\end{tabular} +\endgroup +\label{tab:cv_results} +\end{table} diff --git a/test-cases/alignment/issue-95.tex b/test-cases/alignment/issue-95.tex new file mode 100644 index 00000000..3e5cd773 --- /dev/null +++ b/test-cases/alignment/issue-95.tex @@ -0,0 +1,20 @@ + + +%% cv results +\begin{table}[b!] + \centering + \caption[]{Repetition mean \ac{AUROC} values (bold) and runtime (minutes) for each model and \ac{CV} setting for 200 random search iterations.} + \begingroup\footnotesize + \begin{tabular}{lllll} + \\ + & \specialcell{Non-Spatial/Non-Spatial \\ {(nsp/nsp)}} & \specialcell{Spatial/Non-Spatial \\ {(\emph{sp/nsp})}} & \specialcell{Spatial/Spatial \\ {(\emph{sp/sp})}} & \specialcell{Spatial/No Tuning \\ {(\emph{sp/not})}} \\ + \hline + \ac{SVM} & \textbf{0.906}, 134.30 & \textbf{0.858}, 152.16 & \textbf{0.844}, 128.10 & \textbf{0.814}, 0.31 \\ + \ac{RF} & \textbf{0.945}, 1697.41 & \textbf{0.872}, 1651.95 & \textbf{0.863}, 1594.90 & \textbf{0.872}, 0.28 \\ + \ac{BRT} & \textbf{0.949}, 2923.66 & \textbf{0.873}, 2905.61 & \textbf{0.859}, 2895.17 & \textbf{0.771}, 0.20 \\ + \ac{WKNN} & \textbf{0.895}, 86.67 & \textbf{0.839}, 113.21 & \textbf{0.839}, 81.66 & \textbf{0.841}, 0.22 \\ + \bottomrule + \end{tabular} + \endgroup + \label{tab:cv_results} +\end{table} diff --git a/test-cases/alignment/matrix1-default.tex b/test-cases/alignment/matrix1-default.tex index 8e931fe5..4b481e15 100644 --- a/test-cases/alignment/matrix1-default.tex +++ b/test-cases/alignment/matrix1-default.tex @@ -1,4 +1,4 @@ \matrix { - 1 & 2 & 3 - 4 & 5 & 6 + 1 & 2 & 3 \\ + 4 & 5 & 6 \\ }; diff --git a/test-cases/alignment/matrix1-mod1.tex b/test-cases/alignment/matrix1-mod1.tex new file mode 100644 index 00000000..0946c491 --- /dev/null +++ b/test-cases/alignment/matrix1-mod1.tex @@ -0,0 +1,4 @@ +\matrix { + 1 & 2 & 3 \\ + 4 & 5 & 6 \\ +}; diff --git a/test-cases/alignment/matrix1-mod2.tex b/test-cases/alignment/matrix1-mod2.tex new file mode 100644 index 00000000..50aa2cbc --- /dev/null +++ b/test-cases/alignment/matrix1-mod2.tex @@ -0,0 +1,4 @@ +\matrix { + 1&2&3\\ + 4&5&6\\ +}; diff --git a/test-cases/alignment/matrix1-no-align.tex b/test-cases/alignment/matrix1-no-align.tex index 551e5c99..d78ad4a8 100644 --- a/test-cases/alignment/matrix1-no-align.tex +++ b/test-cases/alignment/matrix1-no-align.tex @@ -1,4 +1,4 @@ \matrix { - 1&2 &3 - 4&5&6 + 1&2 &3\\ + 4&5&6\\ }; diff --git a/test-cases/alignment/matrix1.tex b/test-cases/alignment/matrix1.tex index 5e148d85..edf6f7b4 100644 --- a/test-cases/alignment/matrix1.tex +++ b/test-cases/alignment/matrix1.tex @@ -1,4 +1,4 @@ \matrix { - 1&2 &3 -4&5&6 + 1&2 &3\\ +4&5&6\\ }; diff --git a/test-cases/alignment/matrix1.yaml b/test-cases/alignment/matrix1.yaml new file mode 100644 index 00000000..18271d04 --- /dev/null +++ b/test-cases/alignment/matrix1.yaml @@ -0,0 +1,5 @@ +lookForAlignDelims: + matrix: + spacesBeforeAmpersand: 2 + spacesAfterAmpersand: 3 + spacesBeforeDoubleBackSlash: 5 diff --git a/test-cases/alignment/matrix2.yaml b/test-cases/alignment/matrix2.yaml new file mode 100644 index 00000000..bb295d4a --- /dev/null +++ b/test-cases/alignment/matrix2.yaml @@ -0,0 +1,5 @@ +lookForAlignDelims: + matrix: + spacesBeforeAmpersand: 0 + spacesAfterAmpersand: 0 + spacesBeforeDoubleBackSlash: 0 diff --git a/test-cases/alignment/noMaxDelims.yaml b/test-cases/alignment/noMaxDelims.yaml new file mode 100644 index 00000000..0b5cefa3 --- /dev/null +++ b/test-cases/alignment/noMaxDelims.yaml @@ -0,0 +1,4 @@ +lookForAlignDelims: + tabular: + alignRowsWithoutMaxDelims: 0 + alignDoubleBackSlash: 0 diff --git a/test-cases/alignment/special1-aligned.tex b/test-cases/alignment/special1-aligned.tex index f692574e..af431112 100644 --- a/test-cases/alignment/special1-aligned.tex +++ b/test-cases/alignment/special1-aligned.tex @@ -1,4 +1,4 @@ \[ - 1 & 2 & 3 & 4 \\ - 5 & 6 & 7 & 8 \\ + 1 & 2 & 3 & 4 \\ + 5 & 6 & 7 & 8 \\ \] diff --git a/test-cases/alignment/table5-mod10.tex b/test-cases/alignment/table5-mod10.tex new file mode 100644 index 00000000..f690dd4b --- /dev/null +++ b/test-cases/alignment/table5-mod10.tex @@ -0,0 +1,35 @@ +\documentclass{article} + +\begin{document} + +\begin{tabular}{M|MMMMMMMMM} + & A_1 & A_2 & A_3 & A_4 & A_5 & A_6 & A_7 & A_8 & A_9 \\\hline + A_1 & 0 & & & & & & & & \\ + A_2 & & 0 & & & & & & & \\ + A_3 & & & 0 & & & & & & \\ + A_4 & & & & 0 & & & & & \\ + A_5 & & & & & 0 & & & & \\ + A_6 & & & & & & 0 & & & \\ + A_7 & & & & & & & 0 & & \\ + A_8 & & & & & & & & 0 & \\ + A_9 & & & & & & & & & 0 \\ +\end{tabular} +\begin{tabularx}{M|MMMMMMMMM} + & A_1 & A_2 & A_3 & A_4 & A_5 & A_6 & A_7 & A_8 & A_9 \\\hline + A_1 & 0 & & & & & & & & \\ + A_2 & & 0 & & & & & & & \\ + A_3 & & & 0 & & & & & & \\ + A_4 & & & & 0 & & & & & \\ + A_5 & & & & & 0 & & & & \\ + A_6 & & & & & & 0 & & & \\ + A_7 & & & & & & & 0 & & \\ + A_8 & & & & & & & & 0 & \\ + A_9 & & & & & & & & & 0 \\ +\end{tabularx} +\begin{align*} + CCI_n & = \frac{p_n-SMA(p_n)}{0.015 \cdot \sigma(p_n)} \\ + \textrm{wobei} & n = \textrm{Perioden, i.\,d.\,R. 20};\p_n = \textrm{Typischer Preis/Kurs};\ SMA(p_n) = \textrm{SMA der typischen Preise}; \\ + & \sigma(p_n) = \textrm{Standardabweichung} \\ +\end{align*} +\end{document} + diff --git a/test-cases/alignment/table5-mod11.tex b/test-cases/alignment/table5-mod11.tex new file mode 100644 index 00000000..80f08640 --- /dev/null +++ b/test-cases/alignment/table5-mod11.tex @@ -0,0 +1,35 @@ +\documentclass{article} + +\begin{document} + +\begin{tabular}{M|MMMMMMMMM} + & A_1 & A_2 & A_3 & A_4 & A_5 & A_6 & A_7 & A_8 & A_9 \\\hline + A_1 & 0 & & & & & & & & \\ + A_2 & & 0 & & & & & & & \\ + A_3 & & & 0 & & & & & & \\ + A_4 & & & & 0 & & & & & \\ + A_5 & & & & & 0 & & & & \\ + A_6 & & & & & & 0 & & & \\ + A_7 & & & & & & & 0 & & \\ + A_8 & & & & & & & & 0 & \\ + A_9 & & & & & & & & & 0 \\ +\end{tabular} +\begin{tabularx}{M|MMMMMMMMM} + & A_1 & A_2 & A_3 & A_4 & A_5 & A_6 & A_7 & A_8 & A_9 \\\hline + A_1 & 0 & & & & & & & & \\ + A_2 & & 0 & & & & & & & \\ + A_3 & & & 0 & & & & & & \\ + A_4 & & & & 0 & & & & & \\ + A_5 & & & & & 0 & & & & \\ + A_6 & & & & & & 0 & & & \\ + A_7 & & & & & & & 0 & & \\ + A_8 & & & & & & & & 0 & \\ + A_9 & & & & & & & & & 0 \\ +\end{tabularx} +\begin{align*} + CCI_n & = \frac{p_n-SMA(p_n)}{0.015 \cdot \sigma(p_n)} \\ + \textrm{wobei} & n = \textrm{Perioden, i.\,d.\,R. 20};\p_n = \textrm{Typischer Preis/Kurs};\ SMA(p_n) = \textrm{SMA der typischen Preise}; \\ + & \sigma(p_n) = \textrm{Standardabweichung} \\ +\end{align*} +\end{document} + diff --git a/test-cases/alignment/table5-mod12.tex b/test-cases/alignment/table5-mod12.tex new file mode 100644 index 00000000..ff2a2952 --- /dev/null +++ b/test-cases/alignment/table5-mod12.tex @@ -0,0 +1,35 @@ +\documentclass{article} + +\begin{document} + +\begin{tabular}{M|MMMMMMMMM} + & A_1 & A_2 & A_3 & A_4 & A_5 & A_6 & A_7 & A_8 & A_9 \\\hline + A_1 & 0 & & & & & & & & \\ + A_2 & & 0 & & & & & & & \\ + A_3 & & & 0 & & & & & & \\ + A_4 & & & & 0 & & & & & \\ + A_5 & & & & & 0 & & & & \\ + A_6 & & & & & & 0 & & & \\ + A_7 & & & & & & & 0 & & \\ + A_8 & & & & & & & & 0 & \\ + A_9 & & & & & & & & & 0 \\ +\end{tabular} +\begin{tabularx}{M|MMMMMMMMM} + & A_1 & A_2 & A_3 & A_4 & A_5 & A_6 & A_7 & A_8 & A_9 \\\hline + A_1 & 0 & & & & & & & & \\ + A_2 & & 0 & & & & & & & \\ + A_3 & & & 0 & & & & & & \\ + A_4 & & & & 0 & & & & & \\ + A_5 & & & & & 0 & & & & \\ + A_6 & & & & & & 0 & & & \\ + A_7 & & & & & & & 0 & & \\ + A_8 & & & & & & & & 0 & \\ + A_9 & & & & & & & & & 0 \\ +\end{tabularx} +\begin{align*} + CCI_n & = \frac{p_n-SMA(p_n)}{0.015 \cdot \sigma(p_n)} \\ + \textrm{wobei} & n = \textrm{Perioden, i.\,d.\,R. 20};\p_n = \textrm{Typischer Preis/Kurs};\ SMA(p_n) = \textrm{SMA der typischen Preise}; \\ + & \sigma(p_n) = \textrm{Standardabweichung} \\ +\end{align*} +\end{document} + diff --git a/test-cases/alignment/table5-mod13.tex b/test-cases/alignment/table5-mod13.tex new file mode 100644 index 00000000..38ae3f7f --- /dev/null +++ b/test-cases/alignment/table5-mod13.tex @@ -0,0 +1,35 @@ +\documentclass{article} + +\begin{document} + +\begin{tabular}{M|MMMMMMMMM} + &A_1&A_2&A_3&A_4&A_5&A_6&A_7&A_8&A_9\\\hline + A_1& 0& & & & & & & & \\ + A_2& & 0& & & & & & & \\ + A_3& & & 0& & & & & & \\ + A_4& & & & 0& & & & & \\ + A_5& & & & & 0& & & & \\ + A_6& & & & & & 0& & & \\ + A_7& & & & & & & 0& & \\ + A_8& & & & & & & & 0& \\ + A_9& & & & & & & & & 0\\ +\end{tabular} +\begin{tabularx}{M|MMMMMMMMM} + & A_1 & A_2 & A_3 & A_4 & A_5 & A_6 & A_7 & A_8 & A_9 \\\hline + A_1 & 0 & & & & & & & & \\ + A_2 & & 0 & & & & & & & \\ + A_3 & & & 0 & & & & & & \\ + A_4 & & & & 0 & & & & & \\ + A_5 & & & & & 0 & & & & \\ + A_6 & & & & & & 0 & & & \\ + A_7 & & & & & & & 0 & & \\ + A_8 & & & & & & & & 0 & \\ + A_9 & & & & & & & & & 0 \\ +\end{tabularx} +\begin{align*} + CCI_n & = \frac{p_n-SMA(p_n)}{0.015 \cdot \sigma(p_n)} \\ + \textrm{wobei} & n = \textrm{Perioden, i.\,d.\,R. 20};\p_n = \textrm{Typischer Preis/Kurs};\ SMA(p_n) = \textrm{SMA der typischen Preise}; \\ + & \sigma(p_n) = \textrm{Standardabweichung} \\ +\end{align*} +\end{document} + diff --git a/test-cases/alignment/table5-mod7.tex b/test-cases/alignment/table5-mod7.tex new file mode 100644 index 00000000..8f1a785b --- /dev/null +++ b/test-cases/alignment/table5-mod7.tex @@ -0,0 +1,35 @@ +\documentclass{article} + +\begin{document} + +\begin{tabular}{M|MMMMMMMMM} + & A_1 & A_2 & A_3 & A_4 & A_5 & A_6 & A_7 & A_8 & A_9 \\\hline + A_1 & 0 & & & & & & & & \\ + A_2 & & 0 & & & & & & & \\ + A_3 & & & 0 & & & & & & \\ + A_4 & & & & 0 & & & & & \\ + A_5 & & & & & 0 & & & & \\ + A_6 & & & & & & 0 & & & \\ + A_7 & & & & & & & 0 & & \\ + A_8 & & & & & & & & 0 & \\ + A_9 & & & & & & & & & 0 \\ +\end{tabular} +\begin{tabularx}{M|MMMMMMMMM} + & A_1 & A_2 & A_3 & A_4 & A_5 & A_6 & A_7 & A_8 & A_9 \\\hline + A_1 & 0 & & & & & & & & \\ + A_2 & & 0 & & & & & & & \\ + A_3 & & & 0 & & & & & & \\ + A_4 & & & & 0 & & & & & \\ + A_5 & & & & & 0 & & & & \\ + A_6 & & & & & & 0 & & & \\ + A_7 & & & & & & & 0 & & \\ + A_8 & & & & & & & & 0 & \\ + A_9 & & & & & & & & & 0 \\ +\end{tabularx} +\begin{align*} + CCI_n & = \frac{p_n-SMA(p_n)}{0.015 \cdot \sigma(p_n)} \\ + \textrm{wobei} & n = \textrm{Perioden, i.\,d.\,R. 20};\p_n = \textrm{Typischer Preis/Kurs};\ SMA(p_n) = \textrm{SMA der typischen Preise}; \\ + & \sigma(p_n) = \textrm{Standardabweichung} \\ +\end{align*} +\end{document} + diff --git a/test-cases/alignment/table5-mod8.tex b/test-cases/alignment/table5-mod8.tex new file mode 100644 index 00000000..ec112632 --- /dev/null +++ b/test-cases/alignment/table5-mod8.tex @@ -0,0 +1,35 @@ +\documentclass{article} + +\begin{document} + +\begin{tabular}{M|MMMMMMMMM} + & A_1 & A_2 & A_3 & A_4 & A_5 & A_6 & A_7 & A_8 & A_9 \\\hline + A_1 & 0 & & & & & & & & \\ + A_2 & & 0 & & & & & & & \\ + A_3 & & & 0 & & & & & & \\ + A_4 & & & & 0 & & & & & \\ + A_5 & & & & & 0 & & & & \\ + A_6 & & & & & & 0 & & & \\ + A_7 & & & & & & & 0 & & \\ + A_8 & & & & & & & & 0 & \\ + A_9 & & & & & & & & & 0 \\ +\end{tabular} +\begin{tabularx}{M|MMMMMMMMM} + & A_1 & A_2 & A_3 & A_4 & A_5 & A_6 & A_7 & A_8 & A_9 \\\hline + A_1 & 0 & & & & & & & & \\ + A_2 & & 0 & & & & & & & \\ + A_3 & & & 0 & & & & & & \\ + A_4 & & & & 0 & & & & & \\ + A_5 & & & & & 0 & & & & \\ + A_6 & & & & & & 0 & & & \\ + A_7 & & & & & & & 0 & & \\ + A_8 & & & & & & & & 0 & \\ + A_9 & & & & & & & & & 0 \\ +\end{tabularx} +\begin{align*} + CCI_n & = \frac{p_n-SMA(p_n)}{0.015 \cdot \sigma(p_n)} \\ + \textrm{wobei} & n = \textrm{Perioden, i.\,d.\,R. 20};\p_n = \textrm{Typischer Preis/Kurs};\ SMA(p_n) = \textrm{SMA der typischen Preise}; \\ + & \sigma(p_n) = \textrm{Standardabweichung} \\ +\end{align*} +\end{document} + diff --git a/test-cases/alignment/table5-mod9.tex b/test-cases/alignment/table5-mod9.tex new file mode 100644 index 00000000..1d31c68d --- /dev/null +++ b/test-cases/alignment/table5-mod9.tex @@ -0,0 +1,35 @@ +\documentclass{article} + +\begin{document} + +\begin{tabular}{M|MMMMMMMMM} + &A_1&A_2&A_3&A_4&A_5&A_6&A_7&A_8&A_9\\\hline + A_1&0 & & & & & & & & \\ + A_2& &0 & & & & & & & \\ + A_3& & &0 & & & & & & \\ + A_4& & & &0 & & & & & \\ + A_5& & & & &0 & & & & \\ + A_6& & & & & &0 & & & \\ + A_7& & & & & & &0 & & \\ + A_8& & & & & & & &0 & \\ + A_9& & & & & & & & &0 \\ +\end{tabular} +\begin{tabularx}{M|MMMMMMMMM} + & A_1 & A_2 & A_3 & A_4 & A_5 & A_6 & A_7 & A_8 & A_9 \\\hline + A_1 & 0 & & & & & & & & \\ + A_2 & & 0 & & & & & & & \\ + A_3 & & & 0 & & & & & & \\ + A_4 & & & & 0 & & & & & \\ + A_5 & & & & & 0 & & & & \\ + A_6 & & & & & & 0 & & & \\ + A_7 & & & & & & & 0 & & \\ + A_8 & & & & & & & & 0 & \\ + A_9 & & & & & & & & & 0 \\ +\end{tabularx} +\begin{align*} + CCI_n & = \frac{p_n-SMA(p_n)}{0.015 \cdot \sigma(p_n)} \\ + \textrm{wobei} & n = \textrm{Perioden, i.\,d.\,R. 20};\p_n = \textrm{Typischer Preis/Kurs};\ SMA(p_n) = \textrm{SMA der typischen Preise}; \\ + & \sigma(p_n) = \textrm{Standardabweichung} \\ +\end{align*} +\end{document} + diff --git a/test-cases/alignment/tabular-karl-out10.tex b/test-cases/alignment/tabular-karl-out10.tex new file mode 100644 index 00000000..ffa1fd88 --- /dev/null +++ b/test-cases/alignment/tabular-karl-out10.tex @@ -0,0 +1,17 @@ +\begin{table}[h] + \caption{Muuntajan nimellisarvot ja ylajannitepuolelta mitatut arvot} + \centering + \begin{tabular}{r@{\hspace{2pt}}c@{\hspace{2pt}}lr@{\hspace{2pt}}c@{\hspace{2pt}}lr@{\hspace{2pt}}c@{\hspace{2pt}}l} + \toprule + \multicolumn{3}{l}{Nimellisarvot} & \multicolumn{3}{l}{Tyhjakayntikoe} & \multicolumn{3}{l}{Oikosulkukoe} \\ % & \multicolumn{40}{1}{something} + \midrule + $S_N$ & $=$ & $\SI{1000}{\kV\A}$ & $U_0$ & $=$ & $U_{N1}$ & $U_k$ & $=$ & $\SI{360}{\V}$ \\ + $U_{N1}$ & $=$ & $\SI{6000}{V}$ & $I_0$ & $=$ & $\SI{1.67}{\ampere}$ & $I_k$ & $=$ & $I_{N1}$ \\ + $U_{N2}$ & $=$ & $\SI{400}{\volt}$ & $P_0$ & $=$ & $\SI{1550}{\watt}$ & $P_k$ & $=$ & $\SI{8200}{\W}$ \\ + $f_N$ & $=$ & $\SI{50}{\hertz}$ & & \\ + \bottomrule + \multicolumn{6}{l}{Nimellisarvot} & \multicolumn{3}{l}{Oikosulkukoe} \\ % & \multicolumn{40}{1}{something} + \multicolumn{3}{l}{Nimellisarvot} & \multicolumn{3}{l}{Tyhjakayntikoe} & \multicolumn{3}{l}{Oikosulkukoe} \\ % & \multicolumn{40}{1}{something} + \multicolumn{6}{l}{Nimellisarvot} & more & text & here \\ % & \multicolumn{40}{1}{something} + \end{tabular} +\end{table} diff --git a/test-cases/alignment/tabular-karl-out11.tex b/test-cases/alignment/tabular-karl-out11.tex new file mode 100644 index 00000000..c3559922 --- /dev/null +++ b/test-cases/alignment/tabular-karl-out11.tex @@ -0,0 +1,17 @@ +\begin{table}[h] + \caption{Muuntajan nimellisarvot ja ylajannitepuolelta mitatut arvot} + \centering + \begin{tabular}{r@{\hspace{2pt}}c@{\hspace{2pt}}lr@{\hspace{2pt}}c@{\hspace{2pt}}lr@{\hspace{2pt}}c@{\hspace{2pt}}l} + \toprule + \multicolumn{3}{l}{Nimellisarvot} & \multicolumn{3}{l}{Tyhjakayntikoe} & \multicolumn{3}{l}{Oikosulkukoe} \\ % & \multicolumn{40}{1}{something} + \midrule + $S_N$ & $=$ & $\SI{1000}{\kV\A}$ & $U_0$ & $=$ & $U_{N1}$ & $U_k$ & $=$ & $\SI{360}{\V}$ \\ + $U_{N1}$ & $=$ & $\SI{6000}{V}$ & $I_0$ & $=$ & $\SI{1.67}{\ampere}$ & $I_k$ & $=$ & $I_{N1}$ \\ + $U_{N2}$ & $=$ & $\SI{400}{\volt}$ & $P_0$ & $=$ & $\SI{1550}{\watt}$ & $P_k$ & $=$ & $\SI{8200}{\W}$ \\ + $f_N$ & $=$ & $\SI{50}{\hertz}$ & & \\ + \bottomrule + \multicolumn{6}{l}{Nimellisarvot} & \multicolumn{3}{l}{Oikosulkukoe} \\ % & \multicolumn{40}{1}{something} + \multicolumn{3}{l}{Nimellisarvot} & \multicolumn{3}{l}{Tyhjakayntikoe} & \multicolumn{3}{l}{Oikosulkukoe} \\ % & \multicolumn{40}{1}{something} + \multicolumn{6}{l}{Nimellisarvot} & more & text & here \\ % & \multicolumn{40}{1}{something} + \end{tabular} +\end{table} diff --git a/test-cases/alignment/tabular-karl-out3.tex b/test-cases/alignment/tabular-karl-out3.tex index 07b9f5aa..d20a6618 100644 --- a/test-cases/alignment/tabular-karl-out3.tex +++ b/test-cases/alignment/tabular-karl-out3.tex @@ -5,9 +5,9 @@ \toprule \multicolumn{3}{l}{Nimellisarvot}&\multicolumn{3}{l}{Tyhjakayntikoe}&\multicolumn{3}{l}{Oikosulkukoe}\\ % & \multicolumn{40}{1}{something} \midrule - $S_N$ & $=$ & $\SI{1000}{\kV\A}$ & $U_0$ & $=$ & $U_{N1}$ & $U_k$ & $=$ & $\SI{360}{\V}$ \\ - $U_{N1}$ & $=$ & $\SI{6000}{V}$ & $I_0$ & $=$ & $\SI{1.67}{\ampere}$ & $I_k$ & $=$ & $I_{N1}$ \\ - $U_{N2}$ & $=$ & $\SI{400}{\volt}$ & $P_0$ & $=$ & $\SI{1550}{\watt}$ & $P_k$ & $=$ & $\SI{8200}{\W}$ \\ + $S_N$ & $=$ & $\SI{1000}{\kV\A}$ & $U_0$ & $=$ & $U_{N1}$ & $U_k$ & $=$ & $\SI{360}{\V}$ \\ + $U_{N1}$ & $=$ & $\SI{6000}{V}$ & $I_0$ & $=$ & $\SI{1.67}{\ampere}$ & $I_k$ & $=$ & $I_{N1}$ \\ + $U_{N2}$ & $=$ & $\SI{400}{\volt}$ & $P_0$ & $=$ & $\SI{1550}{\watt}$ & $P_k$ & $=$ & $\SI{8200}{\W}$ \\ $f_N$&$=$&$\SI{50}{\hertz}$&&\\ \bottomrule \multicolumn{6}{l}{Nimellisarvot}&\multicolumn{3}{l}{Oikosulkukoe}\\ % & \multicolumn{40}{1}{something} diff --git a/test-cases/alignment/tabular-karl-out9.tex b/test-cases/alignment/tabular-karl-out9.tex new file mode 100644 index 00000000..667bd214 --- /dev/null +++ b/test-cases/alignment/tabular-karl-out9.tex @@ -0,0 +1,17 @@ +\begin{table}[h] + \caption{Muuntajan nimellisarvot ja ylajannitepuolelta mitatut arvot} + \centering + \begin{tabular}{r@{\hspace{2pt}}c@{\hspace{2pt}}lr@{\hspace{2pt}}c@{\hspace{2pt}}lr@{\hspace{2pt}}c@{\hspace{2pt}}l} + \toprule + \multicolumn{3}{l}{Nimellisarvot}&\multicolumn{3}{l}{Tyhjakayntikoe}&\multicolumn{3}{l}{Oikosulkukoe}\\ % & \multicolumn{40}{1}{something} + \midrule + $S_N$ &$=$&$\SI{1000}{\kV\A}$ &$U_0$&$=$&$U_{N1}$ &$U_k$&$=$ &$\SI{360}{\V}$ \\ + $U_{N1}$&$=$&$\SI{6000}{V}$ &$I_0$&$=$&$\SI{1.67}{\ampere}$ &$I_k$&$=$ &$I_{N1}$ \\ + $U_{N2}$&$=$&$\SI{400}{\volt}$ &$P_0$&$=$&$\SI{1550}{\watt}$ &$P_k$&$=$ &$\SI{8200}{\W}$ \\ + $f_N$ &$=$&$\SI{50}{\hertz}$ & & \\ + \bottomrule + \multicolumn{6}{l}{Nimellisarvot} &\multicolumn{3}{l}{Oikosulkukoe}\\ % & \multicolumn{40}{1}{something} + \multicolumn{3}{l}{Nimellisarvot}&\multicolumn{3}{l}{Tyhjakayntikoe}&\multicolumn{3}{l}{Oikosulkukoe}\\ % & \multicolumn{40}{1}{something} + \multicolumn{6}{l}{Nimellisarvot} &more &text&here \\ % & \multicolumn{40}{1}{something} + \end{tabular} +\end{table} diff --git a/test-cases/alignment/tabular1.yaml b/test-cases/alignment/tabular1.yaml index ae1e815e..ec8fa45f 100644 --- a/test-cases/alignment/tabular1.yaml +++ b/test-cases/alignment/tabular1.yaml @@ -2,4 +2,4 @@ lookForAlignDelims: tabular: delims: 1 alignDoubleBackSlash: 1 - spacesBeforeDoubleBackSlash: 2 + spacesBeforeDoubleBackSlash: 1 diff --git a/test-cases/alignment/tabular10.yaml b/test-cases/alignment/tabular10.yaml new file mode 100644 index 00000000..1a81b530 --- /dev/null +++ b/test-cases/alignment/tabular10.yaml @@ -0,0 +1,5 @@ +lookForAlignDelims: + tabular: + spacesBeforeAmpersand: 2 + spacesAfterAmpersand: 3 + spacesBeforeDoubleBackSlash: 5 diff --git a/test-cases/alignment/tabular11.yaml b/test-cases/alignment/tabular11.yaml new file mode 100644 index 00000000..d2760a29 --- /dev/null +++ b/test-cases/alignment/tabular11.yaml @@ -0,0 +1,5 @@ +lookForAlignDelims: + tabular: + justification: "right" + align*: + justification: "right" diff --git a/test-cases/alignment/tabular7.yaml b/test-cases/alignment/tabular7.yaml new file mode 100644 index 00000000..be939fc3 --- /dev/null +++ b/test-cases/alignment/tabular7.yaml @@ -0,0 +1,3 @@ +lookForAlignDelims: + tabular: + spacesBeforeAmpersand: 2 diff --git a/test-cases/alignment/tabular8.yaml b/test-cases/alignment/tabular8.yaml new file mode 100644 index 00000000..49977651 --- /dev/null +++ b/test-cases/alignment/tabular8.yaml @@ -0,0 +1,3 @@ +lookForAlignDelims: + tabular: + spacesAfterAmpersand: 3 diff --git a/test-cases/alignment/tabular9.yaml b/test-cases/alignment/tabular9.yaml new file mode 100644 index 00000000..decd3cb9 --- /dev/null +++ b/test-cases/alignment/tabular9.yaml @@ -0,0 +1,5 @@ +lookForAlignDelims: + tabular: + spacesAfterAmpersand: 0 + spacesBeforeAmpersand: 0 + spacesBeforeDoubleBackSlash: 0 diff --git a/test-cases/commands/commands-test-cases.sh b/test-cases/commands/commands-test-cases.sh index 182aee9b..9e7de598 100755 --- a/test-cases/commands/commands-test-cases.sh +++ b/test-cases/commands/commands-test-cases.sh @@ -41,6 +41,8 @@ latexindent.pl -s commands-simple-more-text.tex -o=commands-simple-more-text-ind # multiple environments and commands with optional/mandatory arguments latexindent.pl -w figureValign.tex -s # modifyLineBreaks experiments +[[ $loopmin -gt 32 ]] && loopmin=32 && echo "loopmin set to 32" +[[ $loopmax -gt 32 ]] && loopmax=32 && echo "loopmax set to 32" [[ $silentMode == 0 ]] && set +x for (( i=$loopmin ; i <= $loopmax ; i++ )) do @@ -113,8 +115,8 @@ latexindent.pl -s pstricks1.tex -o pstricks1-default.tex -l=../texexchange/inden latexindent.pl -s github-issue-35.tex -o github-issue-35-default.tex latexindent.pl -s github-issue-35.tex -o github-issue-35-no-at.tex -l no-at-between-args.yaml # poly-switch = 3 (add line break experiements) -[[ $loopmin -lt 33 ]] && loopmin=33 && echo "loopmin set to 33" -[[ $loopmax -lt 48 ]] && loopmax=48 && echo "loopmax set to 48" +[[ $loopmin -lt 33 ]] && loopmin=33 && echo "loopmin set to 33" && loopmax=33 && echo "loopmax set to 33" +[[ $loopmax -gt 48 ]] && loopmax=48 && echo "loopmax set to 48" [[ $silentMode == 0 ]] && set +x for (( i=$loopmin ; i <= $loopmax ; i++ )) do diff --git a/test-cases/cruftdirectory/cruft-directory-test-cases.sh b/test-cases/cruftdirectory/cruft-directory-test-cases.sh index 823fcf4f..eb080410 100755 --- a/test-cases/cruftdirectory/cruft-directory-test-cases.sh +++ b/test-cases/cruftdirectory/cruft-directory-test-cases.sh @@ -3,9 +3,9 @@ loopmax=0 . ../common.sh [[ $silentMode == 0 ]] && set -x -latexindent.pl -s cruft-directory1 -c ~/Desktop -w -g=one.log -latexindent.pl -s cruft-directory1 -c ~/Desktop -w -g=two.log -latexindent.pl -s cruft-directory1 -c ~/Desktop -w -l=more-than-one-back-up.yaml -g=three.log +latexindent.pl -s cruft-directory1 -c ~/Desktop/ -w -g=one.log +latexindent.pl -s cruft-directory1 -c ~/Desktop/ -w -g=two.log +latexindent.pl -s cruft-directory1 -c ~/Desktop/ -w -l=more-than-one-back-up.yaml -g=three.log latexindent.pl -s cruft-directory1 -w -l=cycleThroughBackUps.yaml -g=four.log latexindent.pl -s cruft-directory1 -w -l=cycleThroughBackUps.yaml,noCycle.yaml -g=five.log git status diff --git a/test-cases/documentation/appendices-mod1.tex b/test-cases/documentation/appendices-mod1.tex new file mode 100644 index 00000000..1a453c76 --- /dev/null +++ b/test-cases/documentation/appendices-mod1.tex @@ -0,0 +1,222 @@ +% arara: pdflatex: {shell: yes, files: [latexindent]} +\appendix + \section{Required \texttt{Perl} modules} + \label{sec:requiredmodules} + If you intend to use \texttt{latexindent.pl} and \emph{not} one of the supplied standalone executable files, then you will need a few standard Perl modules -- if you can run the minimum code in \cref{lst:helloworld} (\texttt{perl helloworld.pl}) then you will be able to run \texttt{latexindent.pl}, otherwise you may need to install the missing modules -- see \cref{sec:module-installer,sec:manual-module-instal}. + + \begin{cmhlistings}[style=tcblatex,language=Perl]{\texttt{helloworld.pl}}{lst:helloworld} +#!/usr/bin/perl + +use strict; +use warnings; +use utf8; +use PerlIO::encoding; +use Unicode::GCString; +use open ':std', ':encoding(UTF-8)'; +use Text::Wrap; +use Text::Tabs; +use FindBin; +use YAML::Tiny; +use File::Copy; +use File::Basename; +use File::HomeDir; +use Getopt::Long; +use Data::Dumper; +use List::Util qw(max); +use Log::Log4perl qw(get_logger :levels); + +print "hello world"; +exit; +\end{cmhlistings} + + \subsection{Module installer script} + \label{sec:module-installer} + \announce{NEW}{perl module helper script} + \texttt{latexindent.pl} ships with a helper script that will install any missing \texttt{perl} modules on your system; if you run \begin{commandshell} +perl latexindent-module-installer.pl + \end{commandshell} or \begin{dosprompt} +perl latexindent-module-installer.pl + \end{dosprompt} then, once you have answered \texttt{Y}, the appropriate modules will be installed onto your distribution. + + \subsection{Manually installed modules} + \label{sec:manual-module-instal} + Manually installing the modules given in \cref{lst:helloworld} will vary depending on your operating system and \texttt{Perl} distribution. + For example, Ubuntu users might visit the software center, or else run \begin{commandshell} +sudo perl -MCPAN -e 'install "File::HomeDir"' + \end{commandshell} + + Linux users may be interested in exploring Perlbrew \cite{perlbrew}; possible installation and setup options follow for Ubuntu (other distributions will need slightly different commands). + \begin{commandshell} +sudo apt-get install perlbrew +perlbrew install perl-5.22.1 +perlbrew switch perl-5.22.1 +sudo apt-get install curl +curl -L http://cpanmin.us | perl - App::cpanminus +cpanm YAML::Tiny +cpanm File::HomeDir +cpanm Unicode::GCString +cpanm Log::Log4perl +cpanm Log::Dispatch +\end{commandshell} + + Strawberry Perl users on Windows might use \texttt{CPAN client}. + All of the modules are readily available on CPAN \cite{cpan}. + + \texttt{indent.log} will contain details of the location of the Perl modules on your system. + \texttt{latexindent.exe} is a standalone executable for Windows (and therefore does not require a Perl distribution) and caches copies of the Perl modules onto your system; if you wish to see where they are cached, use the \texttt{trace} option, e.g \begin{dosprompt} +latexindent.exe -t myfile.tex + \end{dosprompt} + + \section{Updating the \texttt{path} variable} + \label{sec:updating-path} \texttt{latexindent.pl} has a few scripts (available at \cite{latexindent-home}) that can update the \texttt{path} variables. + Thank you to \cite{jasjuang} for this feature. + If you're on a Linux or Mac machine, then you'll want \texttt{CMakeLists.txt} from \cite{latexindent-home}. + \subsection{Add to path for Linux} + To add \texttt{latexindent.pl} to the path for Linux, follow these steps: + \begin{enumerate} + \item download \texttt{latexindent.pl} and its associated modules, \texttt{defaultSettings.yaml}, to your chosen directory from \cite{latexindent-home} ; + \item within your directory, create a directory called \texttt{path-helper-files} and download \texttt{CMakeLists.txt} and \lstinline!cmake_uninstall.cmake.in! from \cite{latexindent-home}/path-helper-files to this directory; + \item run \begin{commandshell} +ls /usr/local/bin + \end{commandshell} to see what is \emph{currently} in there; + \item run the following commands \begin{commandshell} +sudo apt-get install cmake +sudo apt-get update && sudo apt-get install build-essential +mkdir build && cd build +cmake ../path-helper-files +sudo make install +\end{commandshell} + \item run \begin{commandshell} +ls /usr/local/bin + \end{commandshell} again to check that \texttt{latexindent.pl}, its modules and \texttt{defaultSettings.yaml} have been added. + \end{enumerate} + To \emph{remove} the files, run \begin{commandshell} +sudo make uninstall}. + \end{commandshell} + \subsection{Add to path for Windows} + To add \texttt{latexindent.exe} to the path for Windows, follow these steps: + \begin{enumerate} + \item download \texttt{latexindent.exe}, \texttt{defaultSettings.yaml}, \texttt{add-to-path.bat} from \cite{latexindent-home} to your chosen directory; + \item open a command prompt and run the following command to see what is \emph{currently} in your \lstinline!%path%! variable; \begin{dosprompt} +echo %path% + \end{dosprompt} + \item right click on \texttt{add-to-path.bat} and \emph{Run as administrator}; + \item log out, and log back in; + \item open a command prompt and run \begin{dosprompt} +echo %path% + \end{dosprompt} to check that the appropriate directory has been added to your \lstinline!%path%!. + \end{enumerate} + To \emph{remove} the directory from your \lstinline!%path%!, run \texttt{remove-from-path.bat} as administrator. + + \section{\texttt{logFilePreferences}} + \label{app:logfile-demo} + \Vref{lst:logFilePreferences} describes the options for customising the information given + to the log file, and we provide a few demonstrations here. + Let's say that we start with the code given in \cref{lst:simple}, and the settings specified in \cref{lst:logfile-prefs1-yaml}. + + \begin{minipage}{.35\linewidth} + \cmhlistingsfromfile*{demonstrations/simple.tex}{\texttt{simple.tex}}{lst:simple} + \end{minipage} + \hfill + \begin{minipage}{.6\linewidth} + \cmhlistingsfromfile*{demonstrations/logfile-prefs1.yaml}[yaml-TCB]{\texttt{logfile-prefs1.yaml}}{lst:logfile-prefs1-yaml} + \end{minipage} + + If we run the following command (noting that \texttt{-t} is active) \begin{commandshell} +latexindent.pl -t -l=logfile-prefs1.yaml simple.tex + \end{commandshell} then on inspection of \texttt{indent.log} we will find the snippet given in \cref{lst:indentlog}. + \begin{cmhlistings}[style=tcblatex,morekeywords={TRACE}]{\texttt{indent.log}}{lst:indentlog} + +++++ +TRACE: environment found: myenv + No ancestors found for myenv + Storing settings for myenvenvironments + indentRulesGlobal specified (0) for environments, ... + Using defaultIndent for myenv + Putting linebreak after replacementText for myenv + looking for COMMANDS and key = {value} +TRACE: Searching for commands with optional and/or mandatory arguments AND key = {value} + looking for SPECIAL begin/end +TRACE: Searching myenv for special begin/end (see specialBeginEnd) +TRACE: Searching myenv for optional and mandatory arguments + ... no arguments found + ----- + \end{cmhlistings} + Notice that the information given about \texttt{myenv} is `framed' using \texttt{+++++} and \lstinline!-----! respectively. + + \section{Differences from Version 2.2 to 3.0} + \label{app:differences} + There are a few (small) changes to the interface when comparing Version 2.2 to Version 3.0. + Explicitly, in previous versions you might have run, for example, \begin{commandshell} +latexindent.pl -o myfile.tex outputfile.tex + \end{commandshell} whereas in Version 3.0 you would run any of the following, for example, \begin{commandshell} +latexindent.pl -o=outputfile.tex myfile.tex +latexindent.pl -o outputfile.tex myfile.tex +latexindent.pl myfile.tex -o outputfile.tex +latexindent.pl myfile.tex -o=outputfile.tex +latexindent.pl myfile.tex -outputfile=outputfile.tex +latexindent.pl myfile.tex -outputfile outputfile.tex + \end{commandshell} noting that the \emph{output} file is given \emph{next to} the \texttt{-o} switch. + + The fields given in \cref{lst:obsoleteYaml} are \emph{obsolete} from Version 3.0 onwards. + \begin{yaml}[style=yaml-LST,numbers=none]{Obsolete YAML fields from Version 3.0}[colframe=white!25!red,colbacktitle=white!75!red,colback=white!90!red,]{lst:obsoleteYaml} +alwaysLookforSplitBrackets +alwaysLookforSplitBrackets +checkunmatched +checkunmatchedELSE +checkunmatchedbracket +constructIfElseFi +\end{yaml} + + There is a slight difference when specifying indentation after headings; specifically, we now write \texttt{indentAfterThisHeading} instead of \texttt{indent}. + See \cref{lst:indentAfterThisHeadingOld,lst:indentAfterThisHeadingNew} + + \begin{minipage}{.45\textwidth} + \begin{yaml}[style=yaml-LST,numbers=none]{\texttt{indentAfterThisHeading} in Version 2.2}{lst:indentAfterThisHeadingOld} +indentAfterHeadings: + part: + indent: 0 + level: 1 +\end{yaml} + \end{minipage} \hfill + \begin{minipage}{.45\textwidth} + \begin{yaml}[style=yaml-LST,numbers=none]{\texttt{indentAfterThisHeading} in Version 3.0}{lst:indentAfterThisHeadingNew} +indentAfterHeadings: + part: + indentAfterThisHeading: 0 + level: 1 +\end{yaml} + \end{minipage} + + To specify \texttt{noAdditionalIndent} for display-math environments in Version 2.2, you would write YAML as in \cref{lst:noAdditionalIndentOld}; as of Version 3.0, you would write YAML as in \cref{lst:indentAfterThisHeadingNew1} or, if you're using \texttt{-m} switch, \cref{lst:indentAfterThisHeadingNew2}. + %% + + \begin{minipage}{.45\textwidth} + \begin{yaml}[style=yaml-LST,numbers=none]{\texttt{noAdditionalIndent} in Version 2.2}{lst:noAdditionalIndentOld} +noAdditionalIndent: + \[: 0 + \]: 0 +\end{yaml} + \end{minipage}% + \hfill + \begin{minipage}{.45\textwidth} + \begin{yaml}[style=yaml-LST,numbers=none]{\texttt{noAdditionalIndent} for \texttt{displayMath} in Version 3.0}{lst:indentAfterThisHeadingNew1} +specialBeginEnd: + displayMath: + begin: '\\\[' + end: '\\\]' + lookForThis: 0 +\end{yaml} + + \begin{yaml}[style=yaml-LST,numbers=none]{\texttt{noAdditionalIndent} for \texttt{displayMath} in Version 3.0}{lst:indentAfterThisHeadingNew2} +noAdditionalIndent: + displayMath: 1 +\end{yaml} + \end{minipage}% + + \mbox{}\hfill + \begin{minipage}{.25\textwidth} + \hrule + + \hfill\itshape End\\\mbox{}\hfill\mbox{}\rlap{\hfill\includegraphics{logo}} + + \end{minipage} diff --git a/test-cases/documentation/latexindent-mod1.tex b/test-cases/documentation/latexindent-mod1.tex new file mode 100644 index 00000000..9928f618 --- /dev/null +++ b/test-cases/documentation/latexindent-mod1.tex @@ -0,0 +1,742 @@ +% arara: pdflatex: {shell: yes} +% arara: bibtex +% arara: pdflatex: {shell: yes} +% arara: pdflatex: {shell: yes} +% arara: pdflatex: {shell: yes} +\documentclass[10pt]{article} +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% See <http://www.gnu.org/licenses/>. +\usepackage[left=4.5cm,right=2.5cm,showframe=false, + top=2cm,bottom=1.5cm,marginparsep=2cm]{geometry} % page setup +\usepackage{lmodern} +\usepackage{parskip} % paragraph skips +\usepackage{booktabs} % beautiful tables +\usepackage{listings} % nice verbatim environments +\usepackage{titlesec} % customize headings +\usepackage{titletoc} % customize headings +\usepackage{multicol} +\usepackage{changepage} % adjust width of page +\usepackage{fancyhdr} % headers & footers +\usepackage{wrapfig} +\usepackage{fontawesome} +\usepackage[sc,format=hang,font=small]{caption} % captions +\usepackage[backend=bibtex]{biblatex} % bibliography +\usepackage{tcolorbox} % framed environments +\usepackage{tikz} +\usepackage{xparse} +\usepackage[charter]{mathdesign} % changes font +\usepackage[expansion=false,kerning=true]{microtype} % better kerning +\usepackage{enumitem} % custom lists +\usepackage{longtable} +\usepackage{array} +\usepackage{totalcount} +% setup gitinfo2, as in the manual, details just above begin{document} +\usepackage[mark,grumpy]{gitinfo2} +% tikz, tcolorbox libraries +\usetikzlibrary{positioning} +\usetikzlibrary{decorations.pathmorphing} +\usetikzlibrary{decorations,shapes} +\usepackage{varioref} % the documentation library from tcolorbox loads hyperref +\tcbuselibrary{breakable,minted,xparse,documentation,hooks} +\hypersetup{ + pdfauthor={Chris Hughes}, + pdftitle={latexindent.pl package}, + pdfkeywords={perl;beautify;indentation}, + bookmarksnumbered, + bookmarksopen, + linktocpage, + colorlinks=true, + linkcolor=blue, + citecolor=black, +} +\usepackage{cleveref} + +% create my own star style, for re-use at various points +\tikzset{cmhstar/.style={star,star point ratio=2.25,fill=cmhgold,draw=orange,}} + +% shortcut command for displaying star in documentation +\newcommand{\stardemo}[1][]{\begin{tikzpicture} + \node at (10:.1cm)[very thin,cmhstar,scale=0.25,rotate=20,#1]{}; + \node at (120:.1cm)[very thin,cmhstar,scale=0.15,rotate=-10,#1]{}; + \node at (235:.1cm)[very thin,cmhstar,scale=0.2,rotate=-20,#1]{}; + \end{tikzpicture}} + +% totalcount +\DeclareTotalCounter{lstlisting} + +% customise the \tcbdocnew command +\tcbset{doclang/new={{\bfseries\color{green!50!black}N\normalfont\color{black}}}} +\tcbset{doclang/updated={{\bfseries\color{green!50!black}U\normalfont\color{black}}}} +\tcbset{doc marginnote={width=1.6cm}} +\NewDocumentCommand{\announce}{ s m s m }{% + \IfBooleanTF{#1}% + {% \announce* + \tcbdocmarginnote[overlay={\node at ([yshift=0mm,xshift=1mm]frame.north east) {\stardemo}; }]{% + \IfBooleanTF{#3}% + {% \announce*{date}*[text] means *updated* as of <date> + \tcbdocupdated{#2}% + }% + {% \announce*{date}[text] means *new* as of <date> + \tcbdocnew{#2}% + }% + }% + \IfBooleanTF{#3}% + {% + \addcontentsline{new}{cmhtitle}{#4 (U)}% + }% + {% + \addcontentsline{new}{cmhtitle}{#4 (N)}% + }% + }% + {% \announce + \tcbdocmarginnote{% + \IfBooleanTF{#3}% + {% \announce{date}*[text] means *updated* as of <date> + \tcbdocupdated{#2}% + }% + {% \announce{date}[text] means *new* as of <date> + \tcbdocnew{#2}% + }% + }% + }} + +\reversemarginpar +% bibliographies +\addbibresource{latex-indent} +\addbibresource{contributors} + +% http://tex.stackexchange.com/questions/122135/how-to-add-a-png-icon-on-the-right-side-of-a-tcolorbox-title +\newtcolorbox{warning}{parbox=false,breakable,enhanced,arc=0mm,colback=red!5,colframe=red,leftrule=12mm,% + overlay={\node[anchor=north west,outer sep=2pt] at (frame.north west) {\includegraphics[width=8mm]{warning}}; } +} + +\definecolor{harvestgold}{cmyk}{0.00, 0.05, 0.51, 0.07} %EDE275 +\definecolor{cmhgold}{cmyk}{0,0.178,0.909,0.008} %FDD017 +\makeatletter +\tcbset{ + addtolol/.style={list entry={\kvtcb@title},add to list={lol}{lstlisting}}, + addtololstar/.style={list entry={\kvtcb@title},add to list={lol}{lstlistingstar}}, + cmhlistings/.style={ + % width=\linewidth, + %breakable, + colback=blue!5!white, + colframe=white!25!black,colback=white, + top=0cm, + bottom=0cm, + left=0mm, + listing only, + center title, + listing engine=minted, + minted style=colorful, + minted options={obeytabs=true,showtabs=true,tabsize=4,showspaces=true}, + boxrule=0pt, + toprule=1pt,bottomrule=1pt, + titlerule=1pt, + colframe=white!40!black, + colback=white, + sharp corners, + colbacktitle=white!75!black + }, + yaml-TCB/.style={ + listing only, + listing engine=listings, + left=0cm, + boxrule=0pt, + %leftrule=3pt, + sharp corners, + center title, + %colbacktitle=white!75!black, + colbacktitle=white!75!blue, + colframe=white!25!blue, + colback=white!90!blue, + toprule=2pt, + titlerule=2pt, + %bottomrule=1pt, + }, + MLB-TCB/.style={ + yaml-TCB, + center title, + colframe=cmhgold, + colbacktitle=harvestgold, + colback=white!60!cmhgold, + width=0.9\linewidth, + before=\centering, + %bottomrule=1pt, + enhanced, + overlay={\node[anchor=north east,outer sep=2pt,draw=cmhgold,very thick,double,fill=harvestgold,font =\small] at ([yshift=-3mm]frame.north east) {\texttt{-m}}; } + }, + new-to-this-version/.style={ + enhanced, + overlay app={\node at ([yshift=0mm,xshift=0mm]frame.north east) {\stardemo[scale=1.2]}; }, + addtololstar, + }, +} + +\newtcblisting[use counter=lstlisting]{cmhlistings}[3][]{% + cmhlistings, + addtolol, + center title, + title={\color{black}{\scshape Listing \thetcbcounter}: ~#2},label={#3}, + listing engine=listings, + listing options={#1}, +} + +% \cmhlistingsfromfile +% * no star: not new, star: new +% [ listing/minted options ] +% * no star: uses minted library, star: uses listings library star: +% {<name of listing file>} +% [<options for tcolorbox>] +% {<title>} +% {<label>} +% +% for example, +% \cmhlistingsfromfile*[listing options]... uses listings library and is NEW +% \cmhlistingsfromfile[listing options]... uses listings library +% \cmhlistingsfromfile[listing options]*... uses minted library +% \cmhlistingsfromfile*[listing options]*... uses minted library and is NEW +\DeclareTCBInputListing[use counter=lstlisting]{\cmhlistingsfromfile}{s O{} s m O{} m m}{% + cmhlistings, + listing file={#4}, + IfBooleanTF={#3}{listing options={style=tcblatex,showspaces=false,#2}}{minted options={obeytabs=true,showtabs=false,tabsize=4,showspaces=false,#2}}, + title={\color{black}{\scshape Listing \thetcbcounter}: ~#6},label={#7}, + #5, + IfBooleanTF={#1}{new-to-this-version}{addtolol}, +} + +\makeatletter +\@tempswafalse +\def\@tempa{draft} +\@for\next:=\@classoptionslist\do +{\ifx\next\@tempa\@tempswatrue\fi} +\if@tempswa % draft option is active + \RenewDocumentCommand{\cmhlistingsfromfile}{s O{} s m O{} m m}{\captionof{lstlisting}{#6}\label{#7}} + \renewcommand{\stardemo}[1][]{$\star$} +\fi + +% command shell +\newtcblisting{commandshell}{colback=black,colupper=white,colframe=yellow!75!black, + listing only,listing options={style=tcblatex,language=sh, + morekeywords={latexindent,pl}, + keywordstyle=\color{blue!35!white}\bfseries, + }, + listing engine=listings, + left=0cm, + every listing line={\textcolor{red}{\small\ttfamily\fontseries{b}\selectfont cmh:$\sim$\$ }}} + +% dosprompt +\newtcblisting{dosprompt}{ + colback=black, + colupper=white, + colframe=yellow!75!black, + listing only, + listing options={ + language=command.com, + morekeywords={latexindent,pl}, + keywordstyle=\color{blue!35!white}\bfseries, + basicstyle=\small\color{white}\ttfamily + }, + listing engine=listings, + left=0cm, + every listing line={\textcolor{white}{\small\ttfamily\fontseries{b}\selectfont C:\textbackslash Users\textbackslash cmh$>$}}} + +\lstset{% + basicstyle=\small\ttfamily,language={[LaTeX]TeX}, + numberstyle=\ttfamily%\small, + breaklines=true, + keywordstyle=\color{blue}, % keywords + commentstyle=\color{purple}, % comments + tabsize=3, +}% +\DeclareTCBListing[use counter=lstlisting]{yaml}{O{} m O{} m}{ + yaml-TCB, + listing options={ + style=tcblatex, + numbers=none, + numberstyle=\color{red}, + #1, + }, + title={\color{black}{\scshape Listing \thetcbcounter}: ~#2},label={#4}, + #3, +} + +\lstdefinestyle{yaml-LST}{ + style=tcblatex, + numbers=none, + numberstyle=\color{red}, +} + +\lstdefinestyle{demo}{ + numbers=none, + linewidth=1.25\textwidth, + columns=fullflexible, +} + +\lstdefinestyle{fileExtensionPreference}{ + style=yaml-LST, + firstnumber=38,linerange={38-42}, + numbers=left, +} + +\lstdefinestyle{logFilePreferences}{ + style=yaml-LST, + firstnumber=79,linerange={79-89}, + numbers=left, +} + +\lstdefinestyle{verbatimEnvironments}{ + style=yaml-LST, + firstnumber=93,linerange={93-96}, + numbers=left, +} + +\lstdefinestyle{verbatimCommands}{ + style=yaml-LST, + firstnumber=99,linerange={99-101}, + numbers=left, +} + +\lstdefinestyle{noIndentBlock}{ + style=yaml-LST, + firstnumber=107,linerange={107-109}, + numbers=left, +} + +\lstdefinestyle{removeTrailingWhitespace}{ + style=yaml-LST, + firstnumber=112,linerange={112-114}, + numbers=left, +} + +\lstdefinestyle{fileContentsEnvironments}{ + style=yaml-LST, + firstnumber=118,linerange={118-120}, + numbers=left, +} + +\lstdefinestyle{lookForPreamble}{ + style=yaml-LST, + firstnumber=126,linerange={126-130}, + numbers=left, +} + +\lstdefinestyle{indentAfterItems}{ + style=yaml-LST, + firstnumber=183,linerange={183-187}, + numbers=left, +} + +\lstdefinestyle{itemNames}{ + style=yaml-LST, + firstnumber=193,linerange={193-195}, + numbers=left, +} + +\lstdefinestyle{specialBeginEnd}{ + style=yaml-LST, + firstnumber=199,linerange={199-212}, + numbers=left, +} + +\lstdefinestyle{indentAfterHeadings}{ + style=yaml-LST, + firstnumber=222,linerange={222-231}, + numbers=left, +} + +\lstdefinestyle{noAdditionalIndentGlobalEnv}{ + style=yaml-LST, + firstnumber=280,linerange={280-281}, + numbers=left, +} + +\lstdefinestyle{noAdditionalIndentGlobal}{ + style=yaml-LST, + firstnumber=280,linerange={280-292}, + numbers=left, +} + +\lstdefinestyle{indentRulesGlobalEnv}{ + style=yaml-LST, + firstnumber=296,linerange={296-297}, + numbers=left, +} + +\lstdefinestyle{indentRulesGlobal}{ + style=yaml-LST, + firstnumber=296,linerange={296-308}, + numbers=left, +} + +\lstdefinestyle{commandCodeBlocks}{ + style=yaml-LST, + firstnumber=311,linerange={311-321}, + numbers=left, +} + +\lstdefinestyle{modifylinebreaks}{ + style=yaml-LST, + firstnumber=391,linerange={391-393}, + numbers=left, +} + +\lstdefinestyle{textWrapOptions}{ + style=yaml-LST, + firstnumber=394,linerange={394-395}, + numbers=left, +} + +\lstdefinestyle{textWrapOptionsAll}{ + style=yaml-LST, + firstnumber=394,linerange={394-396}, + numbers=left, +} + +\lstdefinestyle{removeParagraphLineBreaks}{ + style=yaml-LST, + firstnumber=419,linerange={419-431}, + numbers=left, +} + +\lstdefinestyle{paragraphsStopAt}{ + style=yaml-LST, + firstnumber=432,linerange={432-440}, + numbers=left, +} + +\lstdefinestyle{oneSentencePerLine}{ + style=yaml-LST, + firstnumber=397,linerange={397-418}, + numbers=left, +} + +\lstdefinestyle{sentencesFollow}{ + style=yaml-LST, + firstnumber=400,linerange={400-408}, + numbers=left, +} + +\lstdefinestyle{sentencesBeginWith}{ + style=yaml-LST, + firstnumber=409,linerange={409-412}, + numbers=left, +} + +\lstdefinestyle{sentencesEndWith}{ + style=yaml-LST, + firstnumber=413,linerange={413-418}, + numbers=left, +} + +\lstdefinestyle{modifylinebreaksEnv}{ + style=yaml-LST, + firstnumber=441,linerange={441-450}, + numbers=left, +} + +% stars around contributors +\pgfdeclaredecoration{stars}{initial}{ + \state{initial}[width=15pt] + { + \pgfmathparse{round(rnd*100)} + \pgfsetfillcolor{yellow!\pgfmathresult!orange} + \pgfsetstrokecolor{yellow!\pgfmathresult!red} + \pgfnode{star}{center}{}{}{\pgfusepath{stroke,fill}} + } + \state{final} + { + \pgfpathmoveto{\pgfpointdecoratedpathlast} + } +} + +\newtcolorbox{stars}{% + enhanced jigsaw, + breakable, % allow page breaks + left=0cm, + top=0cm, + before skip=0.2cm, + boxsep=0cm, + frame style={draw=none,fill=none}, % hide the default frame + colback=white, + overlay={ + \draw[inner sep=0,minimum size=rnd*15pt+2pt] + decorate[decoration={stars,segment length=2cm}] { + decorate[decoration={zigzag,segment length=2cm,amplitude=0.3cm}] { + ([xshift=-.5cm,yshift=0.1cm]frame.south west) -- ([xshift=-.5cm,yshift=0.4cm]frame.north west) + }}; + \draw[inner sep=0,minimum size=rnd*15pt+2pt] + decorate[decoration={stars,segment length=2cm}] { + decorate[decoration={zigzag,segment length=2cm,amplitude=0.3cm}] { + ([xshift=.75cm,yshift=0.1cm]frame.south east) -- ([xshift=.75cm,yshift=0.6cm]frame.north east) + }}; + \node[anchor=north west,outer sep=2pt,opacity=0.25] at ([xshift=-4.25cm]frame.north west) {\resizebox{3cm}{!}{\faGithub}}; + }, + % paragraph skips obeyed within tcolorbox + parbox=false, +} + +% copied from /usr/local/texlive/2013/texmf-dist/tex/latex/biblatex/bbx/numeric.bbx +% the only modification is the \stars and \endstars +\defbibenvironment{specialbib} +{\stars\list + {\printtext[labelnumberwidth]{% + \printfield{prefixnumber}% + \printfield{labelnumber}}} + {\setlength{\labelwidth}{\labelnumberwidth}% + \setlength{\leftmargin}{\labelwidth}% + \setlength{\labelsep}{\biblabelsep}% + \addtolength{\leftmargin}{\labelsep}% + \setlength{\itemsep}{\bibitemsep}% + \setlength{\parsep}{\bibparsep}}% + \renewcommand*{\makelabel}[1]{\hss##1}} +{\endlist\endstars} +{\item} + +\newtcbox{yamltitlebox}[1][]{colframe=black!50!white,boxrule=.5pt,sharp corners,#1} + +\newcommand{\flagbox}[1]{% + \par + \makebox[30pt][l]{% + \hspace{-1cm}% + \ttfamily\fontseries{b}\selectfont #1 + }% +} + +\NewDocumentCommand{\yamltitle}{O{} m s m}{% + \par + \makebox[30pt][l]{% + \hspace{-2cm}% + \yamltitlebox[#1]{% + {\ttfamily\fontseries{b}\selectfont{\color{blue!80!white}#2}}: % + \IfBooleanTF{#3} + {$\langle$\itshape #4$\rangle$} + {{\bfseries #4}} + }} + \par\nobreak% +} + +\newcommand{\fixthis}[1] +{% + \marginpar{\huge \color{red} \framebox{FIX}}% + \typeout{FIXTHIS: p\thepage : #1^^J}% +} +% custom section +\titleformat{\section} +{\normalfont\Large\bfseries} +{\llap{\thesection\hskip.5cm}} +{0pt} +{} +% custom subsection +\titleformat{\subsection} +{\normalfont\bfseries} +{\llap{\thesubsection\hskip.5cm}} +{0pt} +{} +% custom subsubsection +\titleformat{\subsubsection} +{\normalfont\bfseries} +{\llap{\thesubsubsection\hskip.5cm}} +{0pt} +{} + +\titlespacing +\section{0pt} + {12pt plus 4pt minus 2pt} + {-5pt plus 2pt minus 2pt} +\titlespacing +\subsection{0pt} +{12pt plus 4pt minus 2pt} +{-6pt plus 2pt minus 2pt} +\titlespacing\subsubsection{0pt}{12pt plus 4pt minus 2pt}{-6pt plus 2pt minus 2pt} + +% list of listings +\contentsuse{lstlisting}{lol} +\titleclass{\lstlistingstar}{straight}[\section] +\titleformat{\lstlistingstar}{}{}{}{} +\titlecontents{lstlistingstar}[2em] + {\addvspace{0.25pc}} + {} + {\llap{\stardemo}\thecontentslabel} + {\titlerule*[0.5em]{$\cdot$}\contentspage} + [] +\titlecontents{lstlisting}[2em] + {\addvspace{0.25pc}} + {\thecontentslabel} + {\thecontentslabel} + {\titlerule*[0.5em]{$\cdot$}\contentspage} + [] +\AtBeginDocument{\addtocontents{lol}{\protect\begin{widepage}\protect\begin{multicols}{2}}} +\AtEndDocument{\addtocontents{lol}{\protect\end{multicols}\protect\end{widepage}}} + +% cleveref settings +\crefname{table}{Table}{Tables} +\Crefname{table}{Table}{Tables} +\crefname{figure}{Figure}{Figures} +\Crefname{figure}{Figure}{Figures} +\crefname{section}{Section}{Sections} +\Crefname{section}{Section}{Sections} +\crefname{listing}{Listing}{Listings} +\Crefname{listing}{Listing}{Listings} + +% headers and footers +\fancyhf{} % delete current header and footer +\fancyhead[R]{\bfseries\thepage% + \tikz[remember picture,overlay] { + \node at (1,0){\includegraphics{logo-bw}}; } +} +\fancyhead[L]{\rightmark} +\fancyheadoffset[L]{3cm} +\pagestyle{fancy} + +% renew plain style +\fancypagestyle{plain}{% + \fancyhf{} % clear all header and footer fields + \renewcommand{\headrulewidth}{0pt} + \renewcommand{\footrulewidth}{0pt}} + +% widepage environment +\newenvironment{widepage}{\begin{adjustwidth}{-3cm}{0cm}}{\end{adjustwidth}} + +% symbols for the m switch +\newcommand{\BeginStartsOnOwnLine}{\color{red}\spadesuit} +\newcommand{\BodyStartsOnOwnLine}{\color{red}\heartsuit} +\newcommand{\EndStartsOnOwnLine}{\color{red}\diamondsuit} +\newcommand{\EndFinishesWithLineBreak}{\color{red}\clubsuit} +\newcommand{\ElseStartsOnOwnLine}{\color{red}\bigstar} +\newcommand{\ElseFinishesWithLineBreak}{\color{red}\square} +\newcommand{\EqualsStartsOnOwnLine}{\color{red}\bullet} + +% table rules +\setlength\heavyrulewidth{0.25ex} +% gitinfo2 settings +\renewcommand{\gitMark}{\gitBranch\,@\,\gitAbbrevHash{}\,\textbullet{}\,\gitAuthorDate\,\textbullet{}\faGithub\,\textbullet{}\gitRel} + +% setting up gitinfo2: +% copy the file post-xxx-sample.txt from http://mirror.ctan.org/macros/latex/contrib/gitinfo2 +% and put it in .git/hooks/post-checkout +% then +% cd .git/hooks +% chmod g+x post-checkout +% chmod +x post-checkout +% cp post-checkout post-commit +% cp post-checkout post-merge +% cd ../.. +% git checkout master +% git checkout develop +% ls .git +% and you should see gitHeadInfo.gin + +% http://tex.stackexchange.com/questions/233843/textasteriskcentered-invisible-with-garamondmathdesign +% remove the definition of \textasteriskcentered for TS1 encoding +\UndeclareTextCommand{\textasteriskcentered}{TS1} +% reinstate a default encoding +\DeclareTextSymbolDefault{\textasteriskcentered}{OT1} +% suitably define the command +\DeclareTextCommand{\textasteriskcentered}{OT1}{\raisebox{-.7ex}[1ex][0pt]{*}} + +% new features list +\newcommand{\listOfNewFeatures}{\setcounter{tocdepth}{4}\@starttoc{new}} +\contentsuse{cmhtitle}{new} +% toc settings +\titleclass{\cmhtitle}{straight}[\subsection] +\titleformat{\cmhtitle}{}{}{}{} +\titlecontents{cmhtitle}% <paragaph> + [2cm]% <left> + {\small\itshape}% <above-code> + {}% <numbered-entry-format>; you could also use {\thecontentslabel. } to show the numbers + {}% <numberless-entry-format> + {\titlerule*[0.5em]{$\cdot$}\contentspage} + +\setcounter{secnumdepth}{5} +\begin{document} +\renewcommand*{\thefootnote}{\arabic{footnote}} +\input{title.tex} +\tableofcontents +{\small\lstlistoflistings} +\input{sec-introduction} +\input{sec-demonstration} +\input{sec-how-to-use} +\input{sec-indent-config-and-settings.tex} +\input{sec-default-user-local} +\input{subsec-noAdditionalIndent-indentRules} +\input{subsubsec-environments-and-their-arguments} +\input{subsubsec-environments-with-items} +\input{subsubsec-commands-with-arguments} +\input{subsubsec-ifelsefi} +\input{subsubsec-special} +\input{subsubsec-headings} +\input{subsubsec-no-add-remaining-code-blocks} +\stopcontents[noAdditionalIndent] +\input{subsec-commands-and-their-options} +\input{sec-the-m-switch} +\stopcontents[the-m-switch] +\input{subsec-partnering-poly-switches} +\input{subsec-conflicting-poly-switches} +\input{sec-conclusions-know-limitations} +\input{references} +\input{appendices} +\end{document} + +version history: + +1.0: first release +https://www.ctan.org/ctan-ann/id/mailman.278.1369470527.5851.ctan-ann@dante.de + +1.1R +Changed Bin to RealBin so that I hope the script can get bun­dled into TeXLive 2013. +Some other up­dates, too, detailed in the documentation. +https://www.ctan.org/ctan-ann/id/mailman.3048.1384345731.2385.ctan-ann@dante.de + +1.11R +This release updates the script to use $FindBin::RealBin which should help in the TeXLive implementation. + +Version 2.0R Ver­sion 2.0R of la­texin­dent.pl adds a num­ber of new fea­tures, in­clud­ing: - in­den­ta­tion af­ter \item com­mands - align­ment of de­lim­itered en­vi­ron­ments in com­mands, such as \ma­trix - in­den­ta­tion of \if. +..\else...\fi state­ments - max­i­mum num­ber of back­ups can cy­cle through back­ups - bet­ter sup­port for .cls and .sty files - and a few other bug fixes +https://www.ctan.org/ctan-ann/id/mailman.3090.1417864461.4370.ctan-ann@dante.de + +Version 2.1R in­dent­con­fig.yaml can now be a 'hid­den' file, .in­dent­con­fig.yaml The Win­dows ex­e­cutable file, la­texin­dent.exe, should now work much bet­ter with Win­dows TeXLive. +https://www.ctan.org/ctan-ann/id/mailman.343.1429509943.4405.ctan-ann@dante.de + +Version 2.2 v2.2 addresses a reg­exp issue, and adds a few enhancements; full details are here: https://github.com/cmhughes/latexindent.pl/pull/49 https://www.ctan.org/ctan-ann/id/mailman.198.1477655196.4574.ctan-ann@ctan.org + +Version 3.0 latexindent.pl version 3.0: this represents a complete re-build of the script; full details are given here: https://github.com/cmhughes/la­texin­dent.pl/pull/56 + +V3.0.1 pro­vides sup­port for the align­ment at am­per­sands rou­tine for code that con­tains uni­code char­ac­ters; see https://github.com/cmhughes/la­texin­dent.pl/pull/61 + +V3.0.2 A mi­nor re­lease to fix a small bug re­lated to in­den­tPream­ble; de­tails given here: https://github.com/cmhughes/la­texin­dent.pl/pull/62 + +Ver­sion 3.1 of la­texin­dent.pl, in­clud­ing op­tions for text wrap­ping and para­graph line break re­moval. +Full de­tails here: https://github.com/cmhughes/la­texin­dent.pl/pull/64 + +Ver­sion 3.2 im­ple­ments a new fea­ture called 'mul­ti­Colum­nGroup­ing' which gives a new op­tion for the align­ment-at-am­per­sands rou­tine. +More de­tails are given at +https://github.com/cmhughes/la­texin­dent.pl/pull/67 + +Version 3.2.1 +Upgrades to the -o and -l switches +https://github.com/cmhughes/latexindent.pl/pull/71 + +Version 3.2.2 +Users can specify removeTrailingWhitespace as a scalar, for example, removeTrailingWhitespace: 0 +https://github.com/cmhughes/latexindent.pl/pull/72 + +Version 3.3 +- maximum indentation: https://github.com/cmhughes/latexindent.pl/issues/50 +- blank line poly-switch: https://github.com/cmhughes/latexindent.pl/issues/57 +- ifnextchar issue: https://github.com/cmhughes/latexindent.pl/issues/73 +- the -y/yaml switch: https://github.com/cmhughes/latexindent.pl/issues/79 +- absolute paths for the -l switch: https://github.com/cmhughes/latexindent.pl/issues/82 +bug fixes: +- an ifelsefi bug: https://github.com/cmhughes/latexindent.pl/issues/76 +- empty environment bug: https://github.com/cmhughes/latexindent.pl/issues/78 +- a command/special bug: https://github.com/cmhughes/latexindent.pl/issues/80 +https://github.com/cmhughes/latexindent.pl/releases/tag/V3.3 diff --git a/test-cases/documentation/logo-mod1.tex b/test-cases/documentation/logo-mod1.tex new file mode 100644 index 00000000..3b0841fc --- /dev/null +++ b/test-cases/documentation/logo-mod1.tex @@ -0,0 +1,20 @@ +% arara: pdflatex +% +% to create the black and white logo: +% convert -density 1000 -colorspace GRAY logo.pdf logo-bw.pdf +\documentclass[border=1mm]{standalone} + +\usepackage{tikz} +\usetikzlibrary{matrix} +\definecolor{harvestgold}{cmyk}{0.00, 0.05, 0.51, 0.07} %EDE275 +\definecolor{cmhgold}{cmyk}{0,0.178,0.909,0.008} %FDD017 +\definecolor{bakeoffblue}{cmyk}{0.24, 0.00, 0.02, 0.18} %9fd2cd +\definecolor{bakeoffgreen}{cmyk}{0.30, 0.00, 0.20, 0.29} %80b692 +\definecolor{burntorange}{cmyk}{0.00, 0.41, 1.00, 0.04} +\begin{document} +\begin{tikzpicture}[logo/.style={draw=blue,circle,fill=white}] + \matrix{ + \node[logo,dash pattern=on .5pt off 1.0pt,thick,draw=purple!75!white]{}; & \node[logo,draw=burntorange]{}; \\ + \node[logo,fill,draw=bakeoffgreen,fill=bakeoffblue]{}; & \node[logo,double,draw=cmhgold,fill=harvestgold]{};\\}; +\end{tikzpicture} +\end{document} diff --git a/test-cases/documentation/references-mod1.tex b/test-cases/documentation/references-mod1.tex new file mode 100644 index 00000000..548b3945 --- /dev/null +++ b/test-cases/documentation/references-mod1.tex @@ -0,0 +1,4 @@ +\nocite{*} +\section{References} + \printbibliography[heading=subbibnumbered,title={External links},notkeyword=contributor] + \printbibliography[env=specialbib,heading=subbibnumbered,title={Contributors\label{sec:contributors}},keyword=contributor] diff --git a/test-cases/documentation/sec-conclusions-know-limitations-mod1.tex b/test-cases/documentation/sec-conclusions-know-limitations-mod1.tex new file mode 100644 index 00000000..23d4d753 --- /dev/null +++ b/test-cases/documentation/sec-conclusions-know-limitations-mod1.tex @@ -0,0 +1,23 @@ +% arara: pdflatex: {shell: yes, files: [latexindent]} +\section{Conclusions and known limitations} + \label{sec:knownlimitations} + There are a number of known limitations of the script, and almost certainly quite a few that are \emph{unknown}! + + The main limitation is to do with the alignment routine discussed on \cpageref{yaml:lookforaligndelims}; for example, consider the file given in \cref{lst:matrix2}. + + \cmhlistingsfromfile*{demonstrations/matrix2.tex}{\texttt{matrix2.tex}}{lst:matrix2} + + The default output is given in \cref{lst:matrix2-default}, and it is clear that the alignment routine has not worked as hoped, but it is \emph{expected}. + \cmhlistingsfromfile*{demonstrations/matrix2-default.tex}{\texttt{matrix2.tex} default output}{lst:matrix2-default} + + The reason for the problem is that when \texttt{latexindent.pl} stores its code blocks (see \vref{tab:code-blocks}) it uses replacement tokens. + The alignment routine is using the \emph{length of the replacement token} in its measuring -- I hope to be able to address this in the future. + + There are other limitations to do with the multicolumn alignment routine (see \vref{lst:tabular2-mod2}); in particular, when working with codeblocks in which multicolumn commands overlap, the algorithm can fail. + + Another limitation is to do with efficiency, particularly when the \texttt{-m} switch is active, as this adds many checks and processes. + The current implementation relies upon finding and storing \emph{every} code block (see the discussion on \cpageref{page:phases}); it is hoped that, in a future version, only \emph{nested} code blocks will need to be stored in the `packing' phase, and that this will improve the efficiency of the script. + + You can run \texttt{latexindent} on \texttt{.sty}, \texttt{.cls} and any file types that you specify in \lstinline[breaklines=true]!fileExtensionPreference! (see \vref{lst:fileExtensionPreference}); if you find a case in which the script struggles, please feel free to report it at \cite{latexindent-home}, and in the meantime, consider using a \texttt{noIndentBlock} (see \cpageref{lst:noIndentBlockdemo}). + + I hope that this script is useful to some; if you find an example where the script does not behave as you think it should, the best way to contact me is to report an issue on \cite{latexindent-home}; otherwise, feel free to find me on the \url{http://tex.stackexchange.com/users/6621/cmhughes}. diff --git a/test-cases/documentation/sec-default-user-local-mod1.tex b/test-cases/documentation/sec-default-user-local-mod1.tex new file mode 100644 index 00000000..4f78dcd6 --- /dev/null +++ b/test-cases/documentation/sec-default-user-local-mod1.tex @@ -0,0 +1,521 @@ +% arara: pdflatex: {shell: yes, files: [latexindent]} +\section{defaultSettings.yaml} + \label{sec:defuseloc} + \texttt{latexindent.pl} loads its settings from \texttt{defaultSettings.yaml}. + The idea is to separate the behaviour of the script from the internal working -- this is very similar to the way that we separate content from form when writing our documents in \LaTeX. + + If you look in \texttt{defaultSettings.yaml} you'll find the switches that govern the behaviour of \texttt{latexindent.pl}. + If you're not sure where \texttt{defaultSettings.yaml} resides on your computer, don't worry as \texttt{indent.log} will tell you where to find it. + \texttt{defaultSettings.yaml} is commented, but here is a description of what each switch is designed to do. + The default value is given in each case; whenever you see \emph{integer} in \emph{this} section, assume that it must be greater than or equal to \texttt{0} unless otherwise stated. + +\yamltitle{fileExtensionPreference}*{fields} + \texttt{latexindent.pl} can be called to act on a file without specifying the file extension. + For example we can call \begin{commandshell} +latexindent.pl myfile +\end{commandshell} \begin{wrapfigure}[8]{r}[0pt]{6cm} \cmhlistingsfromfile[style=fileExtensionPreference]*{. + ./defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{fileExtensionPreference}}{lst:fileExtensionPreference} + \end{wrapfigure} + + in which case the script will look for \texttt{myfile} with the extensions + specified in \texttt{fileExtensionPreference} in their numeric order. + If no match is found, the script will exit. + As with all of the fields, you should change and/or add to this as necessary. + + Calling \texttt{latexindent.pl myfile} with the (default) settings specified in \cref{lst:fileExtensionPreference} means that the script will first look for \texttt{myfile.tex}, then \texttt{myfile.sty}, \texttt{myfile.cls}, and finally \texttt{myfile.bib} in order\footnote{Throughout this manual, listings shown with line numbers represent code taken directly from \texttt{defaultSettings.yaml}. + }. + +\yamltitle{backupExtension}*{extension name} + + If you call \texttt{latexindent.pl} with the \texttt{-w} switch (to overwrite \texttt{myfile.tex}) then it will create a backup file before doing any indentation; the default extension is \texttt{.bak}, so, for example, \texttt{myfile.bak0} would be created when calling \texttt{latexindent.pl myfile.tex} for the first time. + + By default, every time you subsequently call \texttt{latexindent.pl} with the \texttt{-w} to act upon \texttt{myfile.tex}, it will create successive back up files: \texttt{myfile.bak1}, \texttt{myfile.bak2}, etc. + +\yamltitle{onlyOneBackUp}*{integer} + \label{page:onlyonebackup} + If you don't want a backup for every time that you call \texttt{latexindent.pl} (so you don't want \texttt{myfile.bak1}, \texttt{myfile.bak2}, etc) and you simply want \texttt{myfile.bak} (or whatever you chose \texttt{backupExtension} to be) then change \texttt{onlyOneBackUp} to \texttt{1}; the default value of \texttt{onlyOneBackUp} is \texttt{0}. + +\yamltitle{maxNumberOfBackUps}*{integer} + Some users may only want a finite number of backup files, say at most $3$, in which case, they can change this switch. + The smallest value of \texttt{maxNumberOfBackUps} is $0$ which will \emph{not} prevent backup files being made; in this case, the behaviour will be dictated entirely by \texttt{onlyOneBackUp}. + The default value of \texttt{maxNumberOfBackUps} is \texttt{0}. + +\yamltitle{cycleThroughBackUps}*{integer} + Some users may wish to cycle through backup files, by deleting the oldest backup file and keeping only the most recent; for example, with \texttt{maxNumberOfBackUps: 4}, and \texttt{cycleThroughBackUps} set to \texttt{1} then the \texttt{copy} procedure given below would be obeyed. + + \begin{commandshell} +copy myfile.bak1 to myfile.bak0 +copy myfile.bak2 to myfile.bak1 +copy myfile.bak3 to myfile.bak2 +copy myfile.bak4 to myfile.bak3 + \end{commandshell} + The default value of \texttt{cycleThroughBackUps} is \texttt{0}. + +\yamltitle{logFilePreferences}*{fields} + \texttt{latexindent.pl} writes information to \texttt{indent.log}, some of which can be customized by changing \texttt{logFilePreferences}; see \cref{lst:logFilePreferences}. + If you load your own user settings (see \vref{sec:indentconfig}) then \texttt{latexindent.pl} will detail them in \texttt{indent.log}; you can choose not to have the details logged by switching \texttt{showEveryYamlRead} to \texttt{0}. + Once all of your settings have been loaded, you can see the amalgamated settings in the log file by switching \texttt{showAmalgamatedSettings} to \texttt{1}, if you wish. + + \cmhlistingsfromfile*[style=logFilePreferences,]*{../defaultSettings.yaml}[width=.9\linewidth,before=\centering,yaml-TCB]{\texttt{logFilePreferences}}{lst:logFilePreferences} + + When \announce*{2018-01-13}{showDecorationStartCodeBlockTrace feature for log file} either of the \texttt{trace} modes (see \cpageref{page:traceswitch}) are active, you will receive detailed information in \texttt{indent.log}. + % + You can specify character strings to appear before and after the notification of a found code block using, respectively, \texttt{showDecorationStartCodeBlockTrace} and \texttt{showDecorationFinishCodeBlockTrace}. + A demonstration is given in \vref{app:logfile-demo}. + + The log file will end with the characters given in \texttt{endLogFileWith}, and will report the \texttt{GitHub} address of \texttt{latexindent.pl} to the log file if \texttt{showGitHubInfoFooter} is set to \texttt{1}. + + \texttt{latexindent.pl} \announce*{2018-01-13}{log file pattern layout for log file} uses the \texttt{log4perl} module \cite{log4perl} to handle the creation of the logfile. + % + You can specify the layout of the information given in the logfile using any of the \texttt{Log Layouts} detailed at \cite{log4perl}. + +\yamltitle{verbatimEnvironments}*{fields} + + A field that contains a list of environments that you would like left completely alone -- no indentation will be performed on environments that you have specified in this field, see \cref{lst:verbatimEnvironments}. + + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile[style=verbatimEnvironments]*{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{verbatimEnvironments}}{lst:verbatimEnvironments} + \end{minipage}% + \hfill + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile[style=verbatimCommands]*{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{verbatimCommands}}{lst:verbatimCommands} + \end{minipage}% + + Note that if you put an environment in \texttt{verbatimEnvironments} and in other fields such as \texttt{lookForAlignDelims} or \texttt{noAdditionalIndent} then \texttt{latexindent.pl} will \emph{always} prioritize \texttt{verbatimEnvironments}. + +\yamltitle{verbatimCommands}*{fields} + A field that contains a list of commands that are verbatim commands, for example \lstinline|\lstinline|; any commands populated in this field are protected from line breaking routines (only relevant if the \texttt{-m} is active, see \vref{sec:modifylinebreaks}). + +\yamltitle{noIndentBlock}*{fields} + + \begin{wrapfigure}[8]{r}[0pt]{6cm} + \cmhlistingsfromfile[style=noIndentBlock]*{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{noIndentBlock}}{lst:noIndentBlock} + \end{wrapfigure} + If you have a block of code that you don't want \texttt{latexindent.pl} to touch (even if it is \emph{not} a verbatim-like environment) then you can wrap it in an environment from \texttt{noIndentBlock}; you can use any name you like for this, provided you populate it as demonstrate in \cref{lst:noIndentBlock}. + + Of course, you don't want to have to specify these as null environments in your code, so you use them with a comment symbol, \lstinline!%!, followed by as many spaces (possibly none) as you like; see \cref{lst:noIndentBlockdemo} for example. + + \begin{cmhlistings}[style=demo,escapeinside={(*@}{@*)}]{\texttt{noIndentBlock} demonstration}{lst:noIndentBlockdemo} +%(*@@*) \begin{noindent} + this code + won't + be touched + by + latexindent.pl! +%(*@@*)\end{noindent} + \end{cmhlistings} + +\yamltitle{removeTrailingWhitespace}*{fields}\label{yaml:removeTrailingWhitespace} + + \begin{wrapfigure}[10]{r}[0pt]{7cm} + \cmhlistingsfromfile[style=removeTrailingWhitespace]*{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{removeTrailingWhitespace}{lst:removeTrailingWhitespace} + + \vspace{.1cm} + \begin{yaml}[numbers=none]{removeTrailingWhitespace (alt)}[width=.8\linewidth,before=\centering]{lst:removeTrailingWhitespace-alt} +removeTrailingWhitespace: 1 +\end{yaml} + \end{wrapfigure} + Trailing white space can be removed both \emph{before} and \emph{after} processing the document, as detailed in \cref{lst:removeTrailingWhitespace}; each of the fields can take the values \texttt{0} or \texttt{1}. + See \vref{lst:removeTWS-before,lst:env-mlb5-modAll,lst:env-mlb5-modAll-remove-WS} for before and after results. + Thanks to \cite{vosskuhle} for providing this feature. + + You can specify \texttt{removeTrailingWhitespace} simply as \texttt{0} or \texttt{1}, if you wish; in this case,% + \announce{2017-06-28}{removeTrailingWhitespace} \texttt{latexindent.pl} will set both \texttt{beforeProcessing} and \texttt{afterProcessing} to the value you specify; see \cref{lst:removeTrailingWhitespace-alt}. +\yamltitle{fileContentsEnvironments}*{field} + + \begin{wrapfigure}[6]{r}[0pt]{6cm} + \cmhlistingsfromfile[style=fileContentsEnvironments]*{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{fileContentsEnvironments}}{lst:fileContentsEnvironments} + \end{wrapfigure} + Before \texttt{latexindent.pl} determines the difference between preamble (if any) and the main document, it first searches for any of the environments specified in \texttt{fileContentsEnvironments}, see \cref{lst:fileContentsEnvironments}. + The behaviour of \texttt{latexindent.pl} on these environments is determined by their location (preamble or not), and the value \texttt{indentPreamble}, discussed next. + +\yamltitle{indentPreamble}{0|1} + + The preamble of a document can sometimes contain some trickier code for \texttt{latexindent.pl} to operate upon. + By default, \texttt{latexindent.pl} won't try to operate on the preamble (as \texttt{indentPreamble} is set to \texttt{0}, by default), but if you'd like \texttt{latexindent.pl} to try then change \texttt{indentPreamble} to \texttt{1}. + +\yamltitle{lookForPreamble}*{fields} + + \begin{wrapfigure}[8]{r}[0pt]{5cm} + \cmhlistingsfromfile[style=lookForPreamble]*{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{lookForPreamble}{lst:lookForPreamble} + \end{wrapfigure} + Not all files contain preamble; for example, \texttt{sty}, \texttt{cls} and \texttt{bib} files typically do \emph{not}. + Referencing \cref{lst:lookForPreamble}, if you set, for example, \texttt{.tex} to \texttt{0}, then regardless of the setting of the value of \texttt{indentPreamble}, preamble will not be assumed when operating upon \texttt{.tex} files. +\yamltitle{preambleCommandsBeforeEnvironments}{0|1} + Assuming that \texttt{latexindent.pl} is asked to operate upon the preamble of a document, when this switch is set to \texttt{0} then environment code blocks will be sought first, and then command code blocks. + When this switch is set to \texttt{1}, commands will be sought first. + The example that first motivated this switch contained the code given in \cref{lst:motivatepreambleCommandsBeforeEnvironments}. + + \begin{cmhlistings}{Motivating \texttt{preambleCommandsBeforeEnvironments}}{lst:motivatepreambleCommandsBeforeEnvironments} +... +preheadhook={\begin{mdframed}[style=myframedstyle]}, +postfoothook=\end{mdframed}, +... +\end{cmhlistings} + +\yamltitle{defaultIndent}*{horizontal space} + This is the default indentation (\lstinline!\t! means a tab, and is the default value) used in the absence of other details for the command or environment we are working with; see \texttt{indentRules} in \vref{sec:noadd-indent-rules} for more details. + + If you're interested in experimenting with \texttt{latexindent.pl} then you can \emph{remove} all indentation by setting \texttt{defaultIndent: ""}. + +\yamltitle{lookForAlignDelims}*{fields}\label{yaml:lookforaligndelims} + \begin{wrapfigure}[12]{r}[0pt]{5cm} + \begin{yaml}[numbers=none]{\texttt{lookForAlignDelims} (basic)}[width=.8\linewidth,before=\centering]{lst:aligndelims:basic} +lookForAlignDelims: + tabular: 1 + tabularx: 1 + longtable: 1 + array: 1 + matrix: 1 + ... + \end{yaml} + \end{wrapfigure} + This contains a list of environments and/or commands that are operated upon in a special way by \texttt{latexindent.pl} (see \cref{lst:aligndelims:basic}). + In fact, the fields in \texttt{lookForAlignDelims} can actually take two different forms: the \emph{basic} version is shown in \cref{lst:aligndelims:basic} and the \emph{advanced} version in \cref{lst:aligndelims:advanced}; we will discuss each in turn. + + The environments specified in this field will be operated on in a special way by \texttt{latexindent.pl}. + In particular, it will try and align each column by its alignment tabs. + It does have some limitations (discussed further in \cref{sec:knownlimitations}), but in many cases it will produce results such as those in \cref{lst:tabularbefore:basic,lst:tabularafter:basic}. + + If you find that \texttt{latexindent.pl} does not perform satisfactorily on such environments then you can set the relevant key to \texttt{0}, for example \texttt{tabular: 0}; alternatively, if you just want to ignore \emph{specific} instances of the environment, you could wrap them in something from \texttt{noIndentBlock} (see \vref{lst:noIndentBlock}). + + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile{demonstrations/tabular1.tex}{\texttt{tabular1.tex}}{lst:tabularbefore:basic} + \end{minipage}% + \hfill + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile{demonstrations/tabular1-default.tex}{\texttt{tabular1.tex} default output}{lst:tabularafter:basic} + \end{minipage}% + + If, for example, you wish to remove the alignment of the \lstinline!\\! within a delimiter-aligned block, then the advanced form of \texttt{lookForAlignDelims} shown in \cref{lst:aligndelims:advanced} is for you. + + \cmhlistingsfromfile*[style=yaml-LST]*{demonstrations/tabular.yaml}[yaml-TCB]{\texttt{tabular.yaml}}{lst:aligndelims:advanced} + + Note that you can use a mixture of the basic and advanced form: in \cref{lst:aligndelims:advanced} \texttt{tabular} and \texttt{tabularx} are advanced and \texttt{longtable} is basic. + When using the advanced form, each field should receive at least 1 sub-field, and \emph{can} (but does not have to) receive any of the following fields: \begin{itemize} \item \texttt{delims}: binary switch (0 or 1) equivalent to simply specifying, for example, \texttt{tabular: 1} in the basic version shown in \cref{lst:aligndelims:basic}. + If \texttt{delims} is set to \texttt{0} then the align at ampersand routine will not be called for this code block (default: 1); + \item \texttt{alignDoubleBackSlash}: binary switch (0 or 1) to determine if \lstinline!\\! should be aligned (default: 1); + \item \texttt{spacesBeforeDoubleBackSlash}: optionally, \announce*{2018-01-13}*{update to spacesBeforeDoubleBackSlash in ampersand alignment} specifies the number (integer $\geq$ 0) of spaces to be inserted before \lstinline!\\! (default: 1). + \footnote{Previously this only activated if \texttt{alignDoubleBackSlash} was set to \texttt{0}.}% + \item \announce{2017-06-19}{multiColumnGrouping} + \texttt{multiColumnGrouping}: binary switch (0 or 1) that details if \texttt{latexindent.pl} should group columns above and below a \lstinline!\multicolumn! command (default: 0); + \item \announce{2017-06-19}{alignRowsWithoutMaxDelims} \texttt{alignRowsWithoutMaxDelims}: binary switch (0 or 1) that details if rows that do not contain the maximum number of delimeters should be formatted so as to have the ampersands aligned (default: 1); + \item \announce*{2018-01-13}{spacesBeforeAmpersand in ampersand alignment}\texttt{spacesBeforeAmpersand}: optionally specifies the number (integer $\geq$ 0) of spaces to be placed \emph{before} ampersands (default: 1); + \item \announce*{2018-01-13}{spacesAfterAmpersand in ampersand alignment}\texttt{spacesAfterAmpersand}: optionally specifies the number (integer $\geq$ 0) of spaces to be placed \emph{After} ampersands (default: 1); + \item \announce*{2018-01-13}{justification of cells in ampersand alignment}\texttt{justification}: optionally specifies the justification of each cell as either \emph{left} or \emph{right} (default: left). + \end{itemize} + + We will explore each of these features using the file \texttt{tabular2.tex} in \cref{lst:tabular2} (which contains a \lstinline!\multicolumn! command), and the YAML files in \crefrange{lst:tabular2YAML}{lst:tabular8YAML}. + + \cmhlistingsfromfile{demonstrations/tabular2.tex}{\texttt{tabular2.tex}}{lst:tabular2} + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/tabular2.yaml}[yaml-TCB]{\texttt{tabular2.yaml}}{lst:tabular2YAML} + \end{minipage}% + \hfill + \begin{minipage}{.48\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/tabular3.yaml}[yaml-TCB]{\texttt{tabular3.yaml}}{lst:tabular3YAML} + \end{minipage}% + + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile*[style=yaml-LST]*{demonstrations/tabular4.yaml}[yaml-TCB]{\texttt{tabular4.yaml}}{lst:tabular4YAML} + \end{minipage}% + \hfill + \begin{minipage}{.48\textwidth} + \cmhlistingsfromfile*[style=yaml-LST]*{demonstrations/tabular5.yaml}[yaml-TCB]{\texttt{tabular5.yaml}}{lst:tabular5YAML} + \end{minipage}% + + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile*[style=yaml-LST]*{demonstrations/tabular6.yaml}[yaml-TCB]{\texttt{tabular6.yaml}}{lst:tabular6YAML} + \end{minipage}% + \hfill + \begin{minipage}{.48\textwidth} + \cmhlistingsfromfile*[style=yaml-LST]*{demonstrations/tabular7.yaml}[yaml-TCB]{\texttt{tabular7.yaml}}{lst:tabular7YAML} + \end{minipage}% + + \begin{minipage}{.48\textwidth} + \cmhlistingsfromfile*[style=yaml-LST]*{demonstrations/tabular8.yaml}[yaml-TCB]{\texttt{tabular8.yaml}}{lst:tabular8YAML} + \end{minipage}% + + On running the commands \begin{commandshell} +latexindent.pl tabular2.tex +latexindent.pl tabular2.tex -l tabular2.yaml +latexindent.pl tabular2.tex -l tabular3.yaml +latexindent.pl tabular2.tex -l tabular2.yaml,tabular4.yaml +latexindent.pl tabular2.tex -l tabular2.yaml,tabular5.yaml +latexindent.pl tabular2.tex -l tabular2.yaml,tabular6.yaml +latexindent.pl tabular2.tex -l tabular2.yaml,tabular7.yaml +latexindent.pl tabular2.tex -l tabular2.yaml,tabular8.yaml + \end{commandshell} we obtain the respective outputs given in \crefrange{lst:tabular2-default}{lst:tabular2-mod8}. + + \begin{widepage} + \cmhlistingsfromfile*{demonstrations/tabular2-default.tex}{\texttt{tabular2.tex} default output}{lst:tabular2-default} + \cmhlistingsfromfile*{demonstrations/tabular2-mod2.tex}{\texttt{tabular2.tex} using \cref{lst:tabular2YAML}}{lst:tabular2-mod2} + \cmhlistingsfromfile*{demonstrations/tabular2-mod3.tex}{\texttt{tabular2.tex} using \cref{lst:tabular3YAML}}{lst:tabular2-mod3} + \cmhlistingsfromfile*{demonstrations/tabular2-mod4.tex}{\texttt{tabular2.tex} using \cref{lst:tabular2YAML,lst:tabular4YAML}}{lst:tabular2-mod4} + \cmhlistingsfromfile*{demonstrations/tabular2-mod5.tex}{\texttt{tabular2.tex} using \cref{lst:tabular2YAML,lst:tabular5YAML}}{lst:tabular2-mod5} + \cmhlistingsfromfile*{demonstrations/tabular2-mod6.tex}{\texttt{tabular2.tex} using \cref{lst:tabular2YAML,lst:tabular6YAML}}{lst:tabular2-mod6} + \cmhlistingsfromfile*{demonstrations/tabular2-mod7.tex}{\texttt{tabular2.tex} using \cref{lst:tabular2YAML,lst:tabular7YAML}}{lst:tabular2-mod7} + \cmhlistingsfromfile*{demonstrations/tabular2-mod8.tex}{\texttt{tabular2.tex} using \cref{lst:tabular2YAML,lst:tabular8YAML}}{lst:tabular2-mod8} + \end{widepage} + + Notice in particular: \begin{itemize} \item in both \cref{lst:tabular2-default,lst:tabular2-mod2} all rows have been aligned at the ampersand, even those that do not contain the maximum number of ampersands (3 ampersands, in this case); + \item in \cref{lst:tabular2-default} the columns have been aligned at the ampersand; + \item in \cref{lst:tabular2-mod2} the \lstinline!\multicolumn! command has grouped the $2$ columns beneath \emph{and} above it, because \texttt{multiColumnGrouping} is set to $1$ in \cref{lst:tabular2YAML}; + \item in \cref{lst:tabular2-mod3} rows~3 and~6 have \emph{not} been aligned at the ampersand, because \texttt{alignRowsWithoutMaxDelims} has been to set to $0$ in \cref{lst:tabular3YAML}; however, the \lstinline!\\! \emph{have} still been aligned; + \item in \cref{lst:tabular2-mod4} the columns beneath and above the \lstinline!\multicolumn! commands have been grouped (because \texttt{multiColumnGrouping} is set to $1$), and there are at least $4$ spaces \emph{before} each aligned ampersand because \texttt{spacesBeforeAmpersand} is set to $4$; + \item in \cref{lst:tabular2-mod5} the columns beneath and above the \lstinline!\multicolumn! commands have been grouped (because \texttt{multiColumnGrouping} is set to $1$), and there are at least $4$ spaces \emph{after} each aligned ampersand because \texttt{spacesAfterAmpersand} is set to $4$; + \item in \cref{lst:tabular2-mod6} the \lstinline!\\! have \emph{not} been aligned, because \texttt{alignDoubleBackSlash} is set to \texttt{0}, otherwise the output is the same as \cref{lst:tabular2-mod2}; + \item in \cref{lst:tabular2-mod7} the \lstinline!\\! \emph{have} been aligned, and because \texttt{spacesBeforeDoubleBackSlash} is set to \texttt{0}, there are no spaces ahead of them; the output is otherwise the same as \cref{lst:tabular2-mod2}. + \item in \cref{lst:tabular2-mod8} the cells have been \emph{right}-justified; note that cells above and below the \lstinline!\multicol! + statements have still been group correctly, because of the settings in \cref{lst:tabular2YAML}. + \end{itemize} + + As of Version 3.0, the alignment routine works on mandatory and optional arguments within commands, and also within `special' code blocks (see \texttt{specialBeginEnd} on \cpageref{yaml:specialBeginEnd}); for example, assuming that you have a command called \lstinline!\matrix! and that it is populated within \texttt{lookForAlignDelims} (which it is, by default), and that you run the command \begin{commandshell} +latexindent.pl matrix1.tex + \end{commandshell} then the before-and-after results shown in \cref{lst:matrixbefore,lst:matrixafter} are achievable by default. + + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile{demonstrations/matrix1.tex}{\texttt{matrix1.tex}}{lst:matrixbefore} + \end{minipage}% + \hfill + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile{demonstrations/matrix1-default.tex}{\texttt{matrix1.tex} default output}{lst:matrixafter} + \end{minipage}% + + If you have blocks of code that you wish to align at the \& character that are \emph{not} wrapped in, for example, \lstinline!\begin{tabular}! \ldots \lstinline!\end{tabular}!, then you can use the mark up illustrated in \cref{lst:alignmentmarkup}; the default output is shown in \cref{lst:alignmentmarkup-default}. + Note that the \lstinline!%*! must be next to each other, but that there can be any number of spaces (possibly none) between the \lstinline!*! and \lstinline!\begin{tabular}!; note also that you may use any environment name that you have specified in \texttt{lookForAlignDelims}. + + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile{demonstrations/align-block.tex}{\texttt{align-block.tex}}{lst:alignmentmarkup} + \end{minipage}% + \hfill + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile{demonstrations/align-block-default.tex}{\texttt{align-block.tex} default output}{lst:alignmentmarkup-default} + \end{minipage}% + + With reference to \vref{tab:code-blocks} and the, yet undiscussed, fields of \texttt{noAdditionalIndent} and \texttt{indentRules} (see \vref{sec:noadd-indent-rules}), these comment-marked blocks are considered \texttt{environments}. + +\yamltitle{indentAfterItems}*{fields} + \begin{wrapfigure}[5]{r}[0pt]{7cm} + \cmhlistingsfromfile[style=indentAfterItems]*{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{indentAfterItems}}{lst:indentafteritems} + \end{wrapfigure} + The environment names specified in \texttt{indentAfterItems} tell \texttt{latexindent.pl} to look for \lstinline!\item! commands; if these switches are set to \texttt{1} then indentation will be performed so as indent the code after each \texttt{item}. + A demonstration is given in \cref{lst:itemsbefore,lst:itemsafter} + + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile{demonstrations/items1.tex}{\texttt{items1.tex}}{lst:itemsbefore} + \end{minipage} \hfill + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile{demonstrations/items1-default.tex}{\texttt{items1.tex} default output}{lst:itemsafter} + \end{minipage} + +\yamltitle{itemNames}*{fields} \begin{wrapfigure}[5]{r}[0pt]{5cm} \cmhlistingsfromfile[style=itemNames]*{. + ./defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{itemNames}}{lst:itemNames}% + \end{wrapfigure} + If you have your own \texttt{item} commands (perhaps you prefer to use \texttt{myitem}, for example) then you can put populate them in \texttt{itemNames}. + For example, users of the \texttt{exam} document class might like to add \texttt{parts} to \texttt{indentAfterItems} and \texttt{part} to \texttt{itemNames} to their user settings (see \vref{sec:indentconfig} for details of how to configure user settings, and \vref{lst:mysettings} \\ in particular \label{page:examsettings}.) + +\yamltitle{specialBeginEnd}*{fields}\label{yaml:specialBeginEnd} + The fields specified% + \announce{2017-08-21}*{specialBeginEnd} in \texttt{specialBeginEnd} are, in their default state, focused on math mode begin and end statements, but there is no requirement for this to be the case; \cref{lst:specialBeginEnd} shows the default settings of \texttt{specialBeginEnd}. + % + + \cmhlistingsfromfile[style=specialBeginEnd]*{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{specialBeginEnd}}{lst:specialBeginEnd} + + The field \texttt{displayMath} represents \lstinline!\[...\]!, \texttt{inlineMath} represents \lstinline!$...$! and \texttt{displayMathTex} represents \lstinline!$$...$$!. + You can, of course, rename these in your own YAML files (see \vref{sec:localsettings}); indeed, you might like to set up your own special begin and end statements. + + A demonstration of the before-and-after results are shown in \cref{lst:specialbefore,lst:specialafter}. + + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile{demonstrations/special1.tex}{\texttt{special1.tex} before}{lst:specialbefore} + \end{minipage}% + \hfill + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile{demonstrations/special1-default.tex}{\texttt{special1.tex} default output}{lst:specialafter} + \end{minipage} + + For each field, \texttt{lookForThis} is set to \texttt{1} by default, which means that \texttt{latexindent.pl} will look for this pattern; you can tell \texttt{latexindent.pl} not to look for the pattern, by setting \texttt{lookForThis} to \texttt{0}. + + There are% + \announce{2017-08-21}{specialBeforeCommand} examples in which it is advantageous to search for \texttt{specialBeginEnd} fields \emph{before} searching for commands, and the \texttt{specialBeforeCommand} switch controls this behaviour. + % + For example, consider the file shown in \cref{lst:specialLRbefore}. + + \cmhlistingsfromfile{demonstrations/specialLR.tex}{\texttt{specialLR.tex}}{lst:specialLRbefore} + + Now consider the YAML files shown in \cref{lst:specialsLeftRight-yaml,lst:specialBeforeCommand-yaml} + + \begin{minipage}{.49\linewidth} + \cmhlistingsfromfile[]*{demonstrations/specialsLeftRight.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{specialsLeftRight.yaml}}{lst:specialsLeftRight-yaml} + \end{minipage} \hfill + \begin{minipage}{.49\linewidth} + \cmhlistingsfromfile[]*{demonstrations/specialBeforeCommand.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{specialBeforeCommand.yaml}}{lst:specialBeforeCommand-yaml} + \end{minipage} + + Upon running the following commands \begin{widepage} \begin{commandshell} +latexindent.pl specialLR.tex -l=specialsLeftRight.yaml +latexindent.pl specialLR.tex -l=specialsLeftRight.yaml,specialBeforeCommand.yaml + \end{commandshell} \end{widepage} we receive the respective outputs in \cref{lst:specialLR-comm-first-tex,lst:specialLR-special-first-tex}. + + \begin{minipage}{.49\linewidth} + \cmhlistingsfromfile{demonstrations/specialLR-comm-first.tex}{\texttt{specialLR.tex} using \cref{lst:specialsLeftRight-yaml}}{lst:specialLR-comm-first-tex} + \end{minipage} + \hfill + \begin{minipage}{.49\linewidth} + \cmhlistingsfromfile{demonstrations/specialLR-special-first.tex}{\texttt{specialLR.tex} using \cref{lst:specialsLeftRight-yaml,lst:specialBeforeCommand-yaml}}{lst:specialLR-special-first-tex} + \end{minipage} + + Notice that in: \begin{itemize} \item \cref{lst:specialLR-comm-first-tex} the \lstinline!\left! has been treated as a \emph{command}, with one optional argument; + \item \cref{lst:specialLR-special-first-tex} the \texttt{specialBeginEnd} pattern in \cref{lst:specialsLeftRight-yaml} has been obeyed because \cref{lst:specialBeforeCommand-yaml} specifies that the \texttt{specialBeginEnd} should be sought \emph{before} commands. + \end{itemize} + +\yamltitle{indentAfterHeadings}*{fields} + \begin{wrapfigure}[17]{r}[0pt]{8cm} + \cmhlistingsfromfile[style=indentAfterHeadings]*{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{indentAfterHeadings}}{lst:indentAfterHeadings} + \end{wrapfigure} + This field enables the user to specify indentation rules that take effect after heading commands such as \lstinline!\part!, \lstinline!\chapter!, \lstinline!\section!, \lstinline!\subsection*!, or indeed any user-specified command written in this field. + \footnote{There is a slight + difference in interface for this field when comparing Version 2.2 to Version 3.0; see \vref{app:differences} for details.} + + The default settings do \emph{not} place indentation after a heading, but you can easily switch them on by changing \\ \texttt{indentAfterThisHeading: 0} to \\ \texttt{indentAfterThisHeading: 1}. + The \texttt{level} field tells \texttt{latexindent.pl} the hierarchy of the heading structure in your document. + You might, for example, like to have both \texttt{section} and \texttt{subsection} set with \texttt{level: 3} because you do not want the indentation to go too deep. + + You can add any of your own custom heading commands to this field, specifying the \texttt{level} as appropriate. + You can also specify your own indentation in \texttt{indentRules} (see \vref{sec:noadd-indent-rules}); you will find the default \texttt{indentRules} contains \lstinline!chapter: " "! which tells \texttt{latexindent.pl} simply to use a space character after \texttt{\chapter} headings (once \texttt{indent} is set to \texttt{1} for \texttt{chapter}). + + For example, assuming that you have the code in \cref{lst:headings1yaml} saved into \texttt{headings1.yaml}, and that you have the text from \cref{lst:headings1} saved into \texttt{headings1.tex}. + + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/headings1.yaml}[yaml-TCB]{\texttt{headings1.yaml}}{lst:headings1yaml} + \end{minipage}% + \hfill + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile{demonstrations/headings1.tex}{\texttt{headings1.tex}}{lst:headings1} + \end{minipage} + + If you run the command \begin{commandshell} +latexindent.pl headings1.tex -l=headings1.yaml +\end{commandshell} then you should receive the output given in \cref{lst:headings1-mod1}. + + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile[showtabs=true]{demonstrations/headings1-mod1.tex}{\texttt{headings1.tex} using \cref{lst:headings1yaml}}{lst:headings1-mod1} + \end{minipage}% + \hfill + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile[showtabs=true]{demonstrations/headings1-mod2.tex}{\texttt{headings1.tex} second modification}{lst:headings1-mod2} + \end{minipage} + + Now say that you modify the \texttt{YAML} from \cref{lst:headings1yaml} so that the \texttt{paragraph} \texttt{level} is \texttt{1}; after running \begin{commandshell} +latexindent.pl headings1.tex -l=headings1.yaml +\end{commandshell} you should receive the code given in \cref{lst:headings1-mod2}; notice that the \texttt{paragraph} and \texttt{subsection} are at the same indentation level. + +\yamltitle{maximumIndentation}*{horizontal space} + You can control the maximum indentation given to your file by% + \announce{2017-08-21}{maximumIndentation} specifying the \texttt{maximumIndentation} field as horizontal space (but \emph{not} including tabs). + % + This feature uses the \texttt{Text::Tabs} module \cite{texttabs}, and is \emph{off} by default. + + For example, consider the example shown in \cref{lst:mult-nested} together with the default output shown in \cref{lst:mult-nested-default}. + + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile{demonstrations/mult-nested.tex}{\texttt{mult-nested.tex}}{lst:mult-nested} + \end{minipage}% + \hfill + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile[showtabs=true]{demonstrations/mult-nested-default.tex}{\texttt{mult-nested.tex} default output}{lst:mult-nested-default} + \end{minipage} + + Now say that, for example, you have the \texttt{max-indentation1.yaml} from \cref{lst:max-indentation1yaml} and that you run the following command: \begin{commandshell} +latexindent.pl mult-nested.tex -l=max-indentation1 + \end{commandshell} You should receive the output shown in \cref{lst:mult-nested-max-ind1}. + + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/max-indentation1.yaml}[yaml-TCB]{\texttt{max-indentation1.yaml}}{lst:max-indentation1yaml} + \end{minipage}% + \hfill + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile[showspaces=true]{demonstrations/mult-nested-max-ind1.tex}{\texttt{mult-nested.tex} using \cref{lst:max-indentation1yaml}}{lst:mult-nested-max-ind1} + \end{minipage} + + Comparing the output in \cref{lst:mult-nested-default,lst:mult-nested-max-ind1} we notice that the (default) tabs of indentation have been replaced by a single space. + + In general, when using the \texttt{maximumIndentation} feature, any leading tabs will be replaced by equivalent spaces except, of course, those found in \texttt{verbatimEnvironments} (see \vref{lst:verbatimEnvironments}) or \texttt{noIndentBlock} (see \vref{lst:noIndentBlock}). + +\subsection{The code blocks known \texttt{latexindent.pl}} + \label{subsubsec:code-blocks} + As of Version 3.0, \texttt{latexindent.pl} processes documents using code blocks; each of these are shown in \cref{tab:code-blocks}. + + \begin{table}[!htp] + \begin{widepage} + \centering + \caption{Code blocks known to \texttt{latexindent.pl}}\label{tab:code-blocks} + \begin{tabular}{m{.3\linewidth}@{\hspace{.25cm}}m{.4\linewidth}@{\hspace{.25cm}}m{.2\linewidth}} + \toprule + Code block & characters allowed in name & example \\ + \midrule + environments & \lstinline!a-zA-Z@\*0-9_\\! & + \begin{lstlisting}[,nolol=true,] +\begin{myenv} +body of myenv +\end{myenv} + \end{lstlisting} + \\\cmidrule{2-3} + optionalArguments & \emph{inherits} name from parent (e.g environment name) & + \begin{lstlisting}[,nolol=true,] +[ +opt arg text +] + \end{lstlisting} + \\\cmidrule{2-3} + mandatoryArguments & \emph{inherits} name from parent (e.g environment name) & + \begin{lstlisting}[,nolol=true,] +{ +mand arg text +} + \end{lstlisting} + \\\cmidrule{2-3} + commands & \lstinline!+a-zA-Z@\*0-9_\:! & \lstinline!\mycommand!$\langle$\itshape{arguments}$\rangle$ \\\cmidrule{2-3} + keyEqualsValuesBracesBrackets & \lstinline!a-zA-Z@\*0-9_\/.\h\{\}:\#-! & \lstinline!my key/.style=!$\langle$\itshape{arguments}$\rangle$ \\\cmidrule{2-3} + namedGroupingBracesBrackets & \lstinline!a-zA-Z@\*><! & \lstinline!in!$\langle$\itshape{arguments}$\rangle$ \\\cmidrule{2-3} + UnNamedGroupingBracesBrackets & \centering\emph{No name! + } & \lstinline!{! or \lstinline![! or \lstinline!,! or \lstinline!&! or \lstinline!)! or \lstinline!(! or \lstinline!$! followed by $\langle$\itshape{arguments}$\rangle$ \\\cmidrule{2-3} + ifElseFi & \lstinline!@a-zA-Z! but must begin with either \newline \lstinline!\if! of \lstinline!\@if! & + \begin{lstlisting}[,nolol=true,] +\ifnum... +... +\else +... +\fi + \end{lstlisting} \\\cmidrule{2-3} + items & User specified, see \vref{lst:indentafteritems,lst:itemNames} & + \begin{lstlisting}[,nolol=true,] +\begin{enumerate} + \item ... +\end{enumerate} + \end{lstlisting} \\\cmidrule{2-3} + specialBeginEnd & User specified, see \vref{lst:specialBeginEnd} & + \begin{lstlisting}[,nolol=true,] +\[ + ... +\] + \end{lstlisting} \\\cmidrule{2-3} + afterHeading & User specified, see \vref{lst:indentAfterHeadings} & + \begin{lstlisting}[,morekeywords={chapter},nolol=true,] +\chapter{title} + ... +\section{title} + \end{lstlisting} \\\cmidrule{2-3} + filecontents & User specified, see \vref{lst:fileContentsEnvironments} & + \begin{lstlisting}[,nolol=true,] +\begin{filecontents} +... +\end{filecontents} + \end{lstlisting} \\ + \bottomrule + \end{tabular} + \end{widepage} + \end{table} + + We will refer to these code blocks in what follows. diff --git a/test-cases/documentation/sec-demonstration-mod1.tex b/test-cases/documentation/sec-demonstration-mod1.tex new file mode 100644 index 00000000..77edd2ae --- /dev/null +++ b/test-cases/documentation/sec-demonstration-mod1.tex @@ -0,0 +1,35 @@ +% arara: pdflatex: {shell: yes, files: [latexindent]} +\section{Demonstration: before and after} + Let's give a demonstration of some before and after code -- after all, you probably won't want to try the script if you don't much like the results. + You might also like to watch the video demonstration I made on youtube \cite{cmh:videodemo} + + As you look at \crefrange{lst:filecontentsbefore}{lst:pstricksafter}, remember that \texttt{latexindent.pl} is just following its rules, and there is nothing particular about these code snippets. + All of the rules can be modified so that you can personalize your indentation scheme. + + In each of the samples given in \crefrange{lst:filecontentsbefore}{lst:pstricksafter} the `before' case is a `worst case scenario' with no effort to make indentation. + The `after' result would be the same, regardless of the leading white space at the beginning of each line which is stripped by \texttt{latexindent.pl} (unless a \texttt{verbatim}-like environment or \texttt{noIndentBlock} is specified -- more on this in \cref{sec:defuseloc}). + + \begin{widepage} + \centering + \begin{minipage}{.45\linewidth} + \cmhlistingsfromfile{demonstrations/filecontents1.tex}{\texttt{filecontents1.tex}}{lst:filecontentsbefore} + \end{minipage}\hfill + \begin{minipage}{.45\linewidth} + \cmhlistingsfromfile{demonstrations/filecontents1-default.tex}{\texttt{filecontents1.tex} default output}{lst:filecontentsafter} + \end{minipage}% + + \begin{minipage}{.45\linewidth} + \cmhlistingsfromfile{demonstrations/tikzset.tex}{\texttt{tikzset.tex}}{lst:tikzsetbefore} + \end{minipage}\hfill + \begin{minipage}{.45\linewidth} + \cmhlistingsfromfile{demonstrations/tikzset-default.tex}{\texttt{tikzset.tex} default output}{lst:tikzsetafter} + \end{minipage}% + + \begin{minipage}{.45\linewidth} + \cmhlistingsfromfile{demonstrations/pstricks.tex}{\texttt{pstricks.tex}}{lst:pstricksbefore} + \end{minipage}\hfill + \begin{minipage}{.45\linewidth} + \cmhlistingsfromfile{demonstrations/pstricks-default.tex}{\texttt{pstricks.tex} default output}{lst:pstricksafter} + \end{minipage}% + \end{widepage} + diff --git a/test-cases/documentation/sec-how-to-use-mod1.tex b/test-cases/documentation/sec-how-to-use-mod1.tex new file mode 100644 index 00000000..40c942db --- /dev/null +++ b/test-cases/documentation/sec-how-to-use-mod1.tex @@ -0,0 +1,297 @@ +% arara: pdflatex: {shell: yes, files: [latexindent]} +\section{How to use the script} + \texttt{latexindent.pl} ships as part of the \TeX Live distribution for Linux and Mac users; \texttt{latexindent.exe} ships as part of the \TeX Live and MiK\TeX{} distributions for Windows users. + These files are also available from github \cite{latexindent-home} should you wish to use them without a \TeX{} distribution; in this case, you may like to read \vref{sec:updating-path} which details how the \texttt{path} variable can be updated. + + In what follows, we will always refer to \texttt{latexindent.pl}, but depending on your operating system and preference, you might substitute \texttt{latexindent.exe} or simply \texttt{latexindent}. + + There are two ways to use \texttt{latexindent.pl}: from the command line, and using \texttt{arara}; we discuss these in \cref{sec:commandline} and \cref{sec:arara} respectively. + We will discuss how to change the settings and behaviour of the script in \vref{sec:defuseloc}. + + \texttt{latexindent.pl} ships with \texttt{latexindent.exe} for Windows users, so that you can use the script with or without a Perl distribution. + If you plan to use \texttt{latexindent.pl} (i.e, the original Perl script) then you will need a few standard Perl modules -- see \vref{sec:requiredmodules} for details;% + \announce{new}{perl module installer helper script} in particular, note that a module installer helper script is shipped with \texttt{latexindent.pl}. + +\subsection{From the command line} + \label{sec:commandline} + \texttt{latexindent.pl} has a number of different switches/flags/options, which can be combined in any way that you like, either in short or long form as detailed below. + \texttt{latexindent.pl} produces a \texttt{.log} file, \texttt{indent.log}, every time it is run; the name of the log file can be customized, but we will refer to the log file as \texttt{indent.log} throughout this document. + There is a base of information that is written to \texttt{indent.log}, but other additional information will be written depending on which of the following options are used. + +\flagbox{-v, --version} + \announce{2017-06-25}{version} + \begin{commandshell} +latexindent.pl -v + \end{commandshell} + This will output only the version number to the terminal. + +\flagbox{-h, --help} + + \begin{commandshell} +latexindent.pl -h + \end{commandshell} + + As above this will output a welcome message to the terminal, including the version number and available options. + \begin{commandshell} +latexindent.pl myfile.tex + \end{commandshell} + + This will operate on \texttt{myfile.tex}, but will simply output to your terminal; \texttt{myfile.tex} will not be changed by \texttt{latexindent.pl} in any way using this command. + +\flagbox{-w, --overwrite} + \begin{commandshell} +latexindent.pl -w myfile.tex +latexindent.pl --overwrite myfile.tex +latexindent.pl myfile.tex --overwrite + \end{commandshell} + + This \emph{will} overwrite \texttt{myfile.tex}, but it will make a copy of \texttt{myfile.tex} first. + You can control the name of the extension (default is \texttt{.bak}), and how many different backups are made -- more on this in \cref{sec:defuseloc}, and in particular see \texttt{backupExtension} and \texttt{onlyOneBackUp}. + + Note that if \texttt{latexindent.pl} can not create the backup, then it will exit without touching your original file; an error message will be given asking you to check the permissions of the backup file. + +\flagbox{-o=output.tex,--outputfile=output.tex} + \begin{commandshell} +latexindent.pl -o=output.tex myfile.tex +latexindent.pl myfile.tex -o=output.tex +latexindent.pl --outputfile=output.tex myfile.tex +latexindent.pl --outputfile output.tex myfile.tex + \end{commandshell} + + This will indent \texttt{myfile.tex} and output it to \texttt{output.tex}, overwriting it (\texttt{output.tex}) if it already exists\footnote{Users of version 2. + * should + note the subtle change in syntax}. + Note that if \texttt{latexindent.pl} is called with both the \texttt{-w} and \texttt{-o} switches, then \texttt{-w} will be ignored and \texttt{-o} will take priority (this seems safer than the other way round). + + Note that using \texttt{-o} as above is equivalent to using \begin{commandshell} +latexindent.pl myfile.tex > output.tex +\end{commandshell} + + You can call the \texttt{-o} switch with the name of the output file \emph{without} an extension; in% + \announce{2017-06-25}{upgrade to -o switch} this case, \texttt{latexindent.pl} will use the extension from the original file. + For example, the following two calls to \texttt{latexindent.pl} are equivalent: \begin{commandshell} +latexindent.pl myfile.tex -o=output +latexindent.pl myfile.tex -o=output.tex +\end{commandshell} + + You can call the \texttt{-o} switch using a \texttt{+} symbol at the beginning; this will% + \announce{2017-06-25}{+ sign in o switch} concatenate the name of the input file and the text given to the \texttt{-o} switch. + For example, the following two calls to \texttt{latexindent.pl} are equivalent: \begin{commandshell} +latexindent.pl myfile.tex -o=+new +latexindent.pl myfile.tex -o=myfilenew.tex +\end{commandshell} + + You can call the \texttt{-o} switch using a \texttt{++} symbol at the end of the name% + \announce{2017-06-25}{++ in o switch} of your output file; this tells \texttt{latexindent.pl} to search successively for the name of your output file concatenated with $0, 1, \ldots$ while the name of the output file exists. + For example, \begin{commandshell} +latexindent.pl myfile.tex -o=output++ +\end{commandshell} tells \texttt{latexindent.pl} to output to \texttt{output0.tex}, but if it exists then output to \texttt{output1.tex}, and so on. + + Calling \texttt{latexindent.pl} with simply \begin{commandshell} +latexindent.pl myfile.tex -o=++ +\end{commandshell} tells it to output to \texttt{myfile0.tex}, but if it exists then output to \texttt{myfile1.tex} and so on. + + The \texttt{+} and \texttt{++} feature of the \texttt{-o} switch can be combined; for example, calling \begin{commandshell} +latexindent.pl myfile.tex -o=+out++ +\end{commandshell} tells \texttt{latexindent.pl} to output to \texttt{myfileout0.tex}, but if it exists, then try \texttt{myfileout1.tex}, and so on. + + There is no need to specify a file extension when using the \texttt{++} feature, but if you wish to, then you should include it \emph{after} the \texttt{++} symbols, for example \begin{commandshell} +latexindent.pl myfile.tex -o=+out++.tex +\end{commandshell} + + See \vref{app:differences} for details of how the interface has changed from Version 2.2 to Version 3.0 for this flag. +\flagbox{-s, --silent} + \begin{commandshell} +latexindent.pl -s myfile.tex +latexindent.pl myfile.tex -s + \end{commandshell} + + Silent mode: no output will be given to the terminal. + +\flagbox{-t, --trace} + \begin{commandshell} +latexindent.pl -t myfile.tex +latexindent.pl myfile.tex -t + \end{commandshell} + + \label{page:traceswitch} + Tracing mode: verbose output will be given to \texttt{indent.log}. + This is useful if \texttt{latexindent.pl} has made a mistake and you're trying to find out where and why. + You might also be interested in learning about \texttt{latexindent.pl}'s thought process -- if so, this switch is for you, although it should be noted that, especially for large files, this does affect performance of the script. + +\flagbox{-tt, --ttrace} + \begin{commandshell} +latexindent.pl -tt myfile.tex +latexindent.pl myfile.tex -tt + \end{commandshell} + + \emph{More detailed} tracing mode: this option gives more details to \texttt{indent.log} + than the standard \texttt{trace} option (note that, even more so than with \texttt{-t}, + especially for large files, performance of the script will be affected). + +\flagbox{-l, --local[=myyaml.yaml,other.yaml,...]} + \begin{commandshell} +latexindent.pl -l myfile.tex +latexindent.pl -l=myyaml.yaml myfile.tex +latexindent.pl -l myyaml.yaml myfile.tex +latexindent.pl -l first.yaml,second.yaml,third.yaml myfile.tex +latexindent.pl -l=first.yaml,second.yaml,third.yaml myfile.tex +latexindent.pl myfile.tex -l=first.yaml,second.yaml,third.yaml + \end{commandshell} + + \label{page:localswitch} + \texttt{latexindent.pl} will always load \texttt{defaultSettings.yaml} (rhymes with camel) and if it is called with the \texttt{-l} switch and it finds \texttt{localSettings.yaml} in the same directory as \texttt{myfile.tex} then these settings will be added to the indentation scheme. + Information will be given in \texttt{indent.log} on the success or failure of loading \texttt{localSettings.yaml}. + + The \texttt{-l} flag can take an \emph{optional} parameter which details the name (or names separated by commas) of a YAML file(s) that resides in the same directory as \texttt{myfile.tex}; you can use this option if you would like to load a settings file in the current working directory that is \emph{not} called \texttt{localSettings.yaml}. + \announce{2017-08-21}*{-l switch absolute paths} + In fact, you can specify both \emph{relative} and \emph{absolute paths} for your YAML files; for example \begin{commandshell} +latexindent.pl -l=../../myyaml.yaml myfile.tex +latexindent.pl -l=/home/cmhughes/Desktop/myyaml.yaml myfile.tex +latexindent.pl -l=C:\Users\cmhughes\Desktop\myyaml.yaml myfile.tex + \end{commandshell} You will find a lot of other explicit demonstrations of how to use the \texttt{-l} switch throughout this documentation, + + You can call the \texttt{-l} switch with a `+' symbol either before or after% + \announce{2017-06-25}{+ sign with -l switch} another YAML file; for example: \begin{commandshell} +latexindent.pl -l=+myyaml.yaml myfile.tex +latexindent.pl -l "+ myyaml.yaml" myfile.tex +latexindent.pl -l=myyaml.yaml+ myfile.tex + \end{commandshell} which translate, respectively, to \begin{commandshell} +latexindent.pl -l=localSettings.yaml,myyaml.yaml myfile.tex +latexindent.pl -l=localSettings.yaml,myyaml.yaml myfile.tex +latexindent.pl -l=myyaml.yaml,localSettings.yaml myfile.tex + \end{commandshell} Note that the following is \emph{not} allowed: \begin{commandshell} +latexindent.pl -l+myyaml.yaml myfile.tex + \end{commandshell} and \begin{commandshell} +latexindent.pl -l + myyaml.yaml myfile.tex + \end{commandshell} will \emph{only} load \texttt{localSettings.yaml}, and \texttt{myyaml.yaml} will be ignored. + If you wish to use spaces between any of the YAML settings, then you must wrap the entire list of YAML files in quotes, as demonstrated above. + + You may also choose to omit the \texttt{yaml} extension, such as% + \announce{2017-06-25}{no extension for -l switch} \begin{commandshell} +latexindent.pl -l=localSettings,myyaml myfile.tex + \end{commandshell} \flagbox{-y, --yaml=yaml settings} \begin{commandshell} +latexindent.pl myfile.tex -y="defaultIndent: ' '" +latexindent.pl myfile.tex -y="defaultIndent: ' ',maximumIndentation:' '" +latexindent.pl myfile.tex -y="indentRules: one: '\t\t\t\t'" +latexindent.pl myfile.tex -y='modifyLineBreaks:environments:EndStartsOnOwnLine:3' -m +latexindent.pl myfile.tex -y='modifyLineBreaks:environments:one:EndStartsOnOwnLine:3' -m + \end{commandshell} \label{page:yamlswitch}You% + \announce{2017-08-21}{the -y switch} can specify YAML settings from the command line using the \texttt{-y} or \texttt{--yaml} switch; sample demonstrations are given above. + % + Note, in particular, that multiple settings can be specified by separating them via commas. + There is a further option to use a \texttt{;} to separate fields, which is demonstrated in \vref{sec:yamlswitch}. + + Any settings specified via this switch will be loaded \emph{after} any specified using the \texttt{-l} switch. + This is discussed further in \vref{sec:loadorder}. +\flagbox{-d, --onlydefault} + \begin{commandshell} +latexindent.pl -d myfile.tex + \end{commandshell} + + Only \texttt{defaultSettings.yaml}: you might like to read \cref{sec:defuseloc} before using this switch. + By default, \texttt{latexindent.pl} will always search for \texttt{indentconfig.yaml} or \texttt{.indentconfig.yaml} in your home directory. + If you would prefer it not to do so then (instead of deleting or renaming \texttt{indentconfig.yaml} or \texttt{.indentconfig.yaml}) you can simply call the script with the \texttt{-d} switch; note that this will also tell the script to ignore \texttt{localSettings.yaml} even if it has been called with the \texttt{-l} switch; \texttt{latexindent.pl}% + \announce{2017-08-21}*{updated -d switch} will also ignore any settings specified from the \texttt{-y} switch. + % + +\flagbox{-c, --cruft=<directory>} + \begin{commandshell} +latexindent.pl -c=/path/to/directory/ myfile.tex + \end{commandshell} + + If you wish to have backup files and \texttt{indent.log} written to a directory other than the current working directory, then you can send these `cruft' files to another directory. + % this switch was made as a result of http://tex.stackexchange.com/questions/142652/output-latexindent-auxiliary-files-to-a-different-directory + +\flagbox{-g, --logfile=<name of log file>} + \begin{commandshell} +latexindent.pl -g=other.log myfile.tex +latexindent.pl -g other.log myfile.tex +latexindent.pl --logfile other.log myfile.tex +latexindent.pl myfile.tex -g other.log + \end{commandshell} + + By default, \texttt{latexindent.pl} reports information to \texttt{indent.log}, but if you wish to change the name of this file, simply call the script with your chosen name after the \texttt{-g} switch as demonstrated above. + +\flagbox{-sl, --screenlog} + \begin{commandshell} +latexindent.pl -sl myfile.tex +latexindent.pl -screenlog myfile.tex + \end{commandshell} + Using this% + \announce*{2018-01-13}{screenlog switch created} option tells \texttt{latexindent.pl} to output the log file to the screen, as well + as to your chosen log file. + +\flagbox{-m, --modifylinebreaks} + \begin{commandshell} +latexindent.pl -m myfile.tex +latexindent.pl -modifylinebreaks myfile.tex + \end{commandshell} + + One of the most exciting developments in Version~3.0 is the ability to modify line breaks; for full details see \vref{sec:modifylinebreaks} + + \texttt{latexindent.pl} can also be called on a file without the file extension, for example \begin{commandshell} +latexindent.pl myfile + \end{commandshell} and in which case, you can specify the order in which extensions are searched for; see \vref{lst:fileExtensionPreference} for full details. +\flagbox{STDIN} + \begin{commandshell} +cat myfile.tex | latexindent.pl + \end{commandshell} + \texttt{latexindent.pl} will% + \announce*{2018-01-13}{STDIN allowed} allow input from STDIN, which means that you can pipe output from + other commands directly into the script. + For example assuming that you have content in \texttt{myfile.tex}, then the above command will output the results of operating upon \texttt{myfile.tex} + + Similarly, if you \announce*{2018-01-13}*{no options/filename updated} simply type \texttt{latexindent.pl} at the command line, then it will expect (STDIN) input from the command line. + % + \begin{commandshell} +latexindent.pl + \end{commandshell} + + Once you have finished typing your input, you can press \begin{itemize} \item \texttt{CTRL+D} on Linux + \item \texttt{CTRL+Z} followed by \texttt{ENTER} on Windows \end{itemize} to signify that your input has finished. + +\subsection{From \texttt{arara}} + \label{sec:arara} + Using \texttt{latexindent.pl} from the command line is fine for some folks, but others may find it easier to use from \texttt{arara}; you can find the arara rule at \cite{paulo}. + + You can use the rule in any of the ways described in \cref{lst:arara} (or combinations thereof). + In fact, \texttt{arara} allows yet greater flexibility -- you can use \texttt{yes/no}, \texttt{true/false}, or \texttt{on/off} to toggle the various options. + \begin{cmhlistings}[style=demo,escapeinside={(*@}{@*)}]{\texttt{arara} sample usage}{lst:arara} +%(*@@*) arara: indent +%(*@@*) arara: indent: {overwrite: yes} +%(*@@*) arara: indent: {output: myfile.tex} +%(*@@*) arara: indent: {silent: yes} +%(*@@*) arara: indent: {trace: yes} +%(*@@*) arara: indent: {localSettings: yes} +%(*@@*) arara: indent: {onlyDefault: on} +%(*@@*) arara: indent: { cruft: /home/cmhughes/Desktop } +\documentclass{article} +... +\end{cmhlistings} + %(*@@*) arara: indent: { modifylinebreaks: yes } + + Hopefully the use of these rules is fairly self-explanatory, but for completeness \cref{tab:orbsandswitches} shows the relationship between \texttt{arara} directive arguments and the switches given in \cref{sec:commandline}. + + \begin{table}[!ht] + \centering + \caption{\texttt{arara} directive arguments and corresponding switches} + \label{tab:orbsandswitches} + \begin{tabular}{lc} + \toprule + \texttt{arara} directive argument & switch \\ + \midrule + \texttt{overwrite} & \texttt{-w} \\ + \texttt{output} & \texttt{-o} \\ + \texttt{silent} & \texttt{-s} \\ + \texttt{trace} & \texttt{-t} \\ + \texttt{localSettings} & \texttt{-l} \\ + \texttt{onlyDefault} & \texttt{-d} \\ + \texttt{cruft} & \texttt{-c} \\ + %\texttt{modifylinebreaks} & \texttt{-m} \\ + \bottomrule + \end{tabular} + \end{table} + + The \texttt{cruft} directive does not work well when used with directories that contain spaces. + diff --git a/test-cases/documentation/sec-indent-config-and-settings-mod1.tex b/test-cases/documentation/sec-indent-config-and-settings-mod1.tex new file mode 100644 index 00000000..ebbf4ad4 --- /dev/null +++ b/test-cases/documentation/sec-indent-config-and-settings-mod1.tex @@ -0,0 +1,146 @@ +% arara: pdflatex: {shell: yes, files: [latexindent]} +\section{\texttt{indentconfig.yaml}, local settings and the \texttt{-y} switch } + \label{sec:indentconfig} + The behaviour of \texttt{latexindent.pl} is controlled from the settings specified in any of the YAML files that you tell it to load. + By default, \texttt{latexindent.pl} will only load \texttt{defaultSettings.yaml}, but there are a few ways that you can tell it to load your own settings files. + +\subsection{\texttt{indentconfig.yaml} and \texttt{{.indentconfig.yaml}}} + \texttt{latexindent.pl} will always check your home directory for \texttt{indentconfig.yaml} and \texttt{.indentconfig.yaml} (unless it is called with the \texttt{-d} switch), which is a plain text file you can create that contains the \emph{absolute} paths for any settings files that you wish \texttt{latexindent.pl} to load. + There is no difference between \texttt{indentconfig.yaml} and \texttt{.indentconfig.yaml}, other than the fact that \texttt{.indentconfig.yaml} is a `hidden' file; thank you to \cite{jacobo-diaz-hidden-config} for providing this feature. + In what follows, we will use \texttt{indentconfig.yaml}, but it is understood that this could equally represent \texttt{.indentconfig.yaml}. + If you have both files in existence then \texttt{indentconfig.yaml} takes priority. + + For Mac and Linux users, their home directory is \texttt{~/username} while Windows (Vista onwards) is \lstinline!C:\Users\username!\footnote{If you're not sure where to put \texttt{indentconfig.yaml}, don't worry \texttt{latexindent.pl} will tell you in the log file exactly where to put it assuming it doesn't exist already. + } + \Cref{lst:indentconfig} shows a sample \texttt{indentconfig.yaml} file. + + \begin{yaml}{\texttt{indentconfig.yaml} (sample)}{lst:indentconfig} +# Paths to user settings for latexindent.pl +# +# Note that the settings will be read in the order you +# specify here- each successive settings file will overwrite +# the variables that you specify + +paths: +- /home/cmhughes/Documents/yamlfiles/mysettings.yaml +- /home/cmhughes/folder/othersettings.yaml +- /some/other/folder/anynameyouwant.yaml +- C:\Users\chughes\Documents\mysettings.yaml +- C:\Users\chughes\Desktop\test spaces\more spaces.yaml +\end{yaml} + + Note that the \texttt{.yaml} files you specify in \texttt{indentconfig.yaml} will be loaded in the order in which you write them. + Each file doesn't have to have every switch from \texttt{defaultSettings.yaml}; in fact, I recommend that you only keep the switches that you want to \emph{change} in these settings files. + + To get started with your own settings file, you might like to save a copy of \texttt{defaultSettings.yaml} in another directory and call it, for example, \texttt{mysettings.yaml}. + Once you have added the path to \texttt{indentconfig.yaml} you can change the switches and add more code-block names to it as you see fit -- have a look at \cref{lst:mysettings} for an example that uses four tabs for the default indent, adds the \texttt{tabbing} environment/command to the list of environments that contains alignment delimiters; you might also like to refer to the many YAML files detailed throughout the rest of this documentation. + + \begin{yaml}{\texttt{mysettings.yaml} (example)}{lst:mysettings} +# Default value of indentation +defaultIndent: "\t\t\t\t" + +# environments that have tab delimiters, add more +# as needed +lookForAlignDelims: + tabbing: 1 +\end{yaml} + + You can make sure that your settings are loaded by checking \texttt{indent.log} for details -- if you have specified a path that \texttt{latexindent.pl} doesn't recognize then you'll get a warning, otherwise you'll get confirmation that \texttt{latexindent.pl} has read your settings file \footnote{Windows users may find that they have to end \texttt{.yaml} files with a blank line}. + + \begin{warning} + When editing \texttt{.yaml} files it is \emph{extremely} important to remember how sensitive they are to spaces. + I highly recommend copying and pasting from \texttt{defaultSettings.yaml} when you create your first \texttt{whatevernameyoulike.yaml} file. + + If \texttt{latexindent.pl} can not read your \texttt{.yaml} file it will tell you so in \texttt{indent.log}. + \end{warning} + +\subsection{\texttt{localSettings.yaml}} + \label{sec:localsettings} + The \texttt{-l} switch tells \texttt{latexindent.pl} to look for \texttt{localSettings.yaml} in the \emph{same directory} as \texttt{myfile.tex}. + For example, if you use the following command \begin{commandshell} +latexindent.pl -l myfile.tex +\end{commandshell} then \texttt{latexindent.pl} will (assuming it exists) load \texttt{localSettings.yaml} from the same directory as \texttt{myfile.tex}. + + If you'd prefer to name your \texttt{localSettings.yaml} file something different, (say, \texttt{mysettings.yaml} as in \cref{lst:mysettings}) then you can call \texttt{latexindent.pl} using, for example, \begin{commandshell} +latexindent.pl -l=mysettings.yaml myfile.tex +\end{commandshell} + + Any settings file(s) specified using the \texttt{-l} switch will be read \emph{after} \texttt{defaultSettings.yaml} and, assuming they exist, any user setting files specified in \texttt{indentconfig.yaml}. + + Your settings file can contain any switches that you'd like to change; a sample is shown in \cref{lst:localSettings}, and you'll find plenty of further examples throughout this manual. + + \begin{yaml}{\texttt{localSettings.yaml} (example)}{lst:localSettings} +# verbatim environments - environments specified +# here will not be changed at all! +verbatimEnvironments: + cmhenvironment: 0 + myenv: 1 +\end{yaml} + + You can make sure that your settings file has been loaded by checking \texttt{indent.log} for details; if it can not be read then you receive a warning, otherwise you'll get confirmation that \texttt{latexindent.pl} has read your settings file. + +\subsection{The \texttt{-y|yaml} switch} + \label{sec:yamlswitch} + You% + \announce{2017-08-21}{demonstration of the -y switch} may use the \texttt{-y} switch to load your settings; for example, if you wished to specify the settings from \cref{lst:localSettings} using the \texttt{-y} switch, then you could use the following command: \begin{commandshell} +latexindent.pl -y="verbatimEnvironments:cmhenvironment:0;myenv:1" myfile.tex + \end{commandshell} Note the use of \texttt{;} to specify another field within \texttt{verbatimEnvironments}. + % + This is shorthand, and equivalent, to using the following command: \begin{commandshell} +latexindent.pl -y="verbatimEnvironments:cmhenvironment:0,verbatimEnvironments:myenv:1" myfile.tex + \end{commandshell} You may, of course, specify settings using the \texttt{-y} switch as well as, for example, settings loaded using the \texttt{-l} switch; for example, \begin{commandshell} +latexindent.pl -l=mysettings.yaml -y="verbatimEnvironments:cmhenvironment:0;myenv:1" myfile.tex + \end{commandshell} Any settings specified using the \texttt{-y} switch will be loaded \emph{after} any specified using \texttt{indentconfig.yaml} and the \texttt{-l} switch. + +\subsection{Settings load order} + \label{sec:loadorder} + \texttt{latexindent.pl} loads the settings files in the following order: + \begin{enumerate} + \item \texttt{defaultSettings.yaml} is always loaded, and can not be renamed; + \item \texttt{anyUserSettings.yaml} and any other arbitrarily-named files specified in \texttt{indentconfig.yaml}; + \item \texttt{localSettings.yaml} but only if found in the same directory as \texttt{myfile.tex} and called with \texttt{-l} switch; this file can be renamed, provided that the call to \texttt{latexindent.pl} is adjusted accordingly (see \cref{sec:localsettings}). + You may specify both relative and absolute% + \announce{2017-08-21}*{-l absolute paths} paths to other YAML files using the \texttt{-l} switch, separating multiple files using commas; + \item any settings% + \announce{2017-08-21}{-y switch load order} specified in the \texttt{-y} switch. + %% + \end{enumerate} + A visual representation of this is given in \cref{fig:loadorder}. + + \begin{figure}[!htb] + \centering + \begin{tikzpicture}[ + needed/.style={very thick, draw=blue,fill=blue!20, + text centered, minimum height=2.5em,rounded corners=1ex}, + optional/.style={draw=black, very thick,scale=0.8, + text centered, minimum height=2.5em,rounded corners=1ex}, + optionalfill/.style={fill=black!10}, + connections/.style={draw=black!30,dotted,line width=3pt,text=red}, + ] + % Draw diagram elements + \node (latexindent) [needed,circle] {\texttt{latexindent.pl}}; + \node (default) [needed,above right=.5cm of latexindent] {\texttt{defaultSettings.yaml}}; + \node (indentconfig) [optional,right=of latexindent] {\texttt{indentconfig.yaml}}; + \node (any) [optional,optionalfill,above right=of indentconfig] {\texttt{any.yaml}}; + \node (name) [optional,optionalfill,right=of indentconfig] {\texttt{name.yaml}}; + \node (you) [optional,optionalfill,below right=of indentconfig] {\texttt{you.yaml}}; + \node (want) [optional,optionalfill,below=of indentconfig] {\texttt{want.yaml}}; + \node (local) [optional,below=of latexindent] {\texttt{localSettings.yaml}}; + \node (yamlswitch) [optional,left=of latexindent] {\texttt{-y switch}}; + % Draw arrows between elements + \draw[connections,solid] (latexindent) to[in=-90]node[pos=0.5,anchor=north]{1} (default.south) ; + \draw[connections,optional] (latexindent) -- node[pos=0.5,anchor=north]{2} (indentconfig) ; + \draw[connections,optional] (indentconfig) to[in=-90] (any.south) ; + \draw[connections,optional] (indentconfig) -- (name) ; + \draw[connections,optional] (indentconfig) to[out=-45,in=90] (you) ; + \draw[connections,optional] (indentconfig) -- (want) ; + \draw[connections,optional] (latexindent) -- node[pos=0.5,anchor=west]{3} (local) ; + \draw[connections,optional] (latexindent) -- node[pos=0.5,anchor=north]{4} (yamlswitch) ; + \end{tikzpicture} + \caption{Schematic of the load order described in \cref{sec:loadorder}; solid lines represent + mandatory files, dotted lines represent optional files. + \texttt{indentconfig.yaml} can contain as many files as you like. + The files will be loaded in order; if you specify settings for the same field in more than one file, the most recent takes priority. + } + \label{fig:loadorder} + \end{figure} diff --git a/test-cases/documentation/sec-introduction-mod1.tex b/test-cases/documentation/sec-introduction-mod1.tex new file mode 100644 index 00000000..9c353cda --- /dev/null +++ b/test-cases/documentation/sec-introduction-mod1.tex @@ -0,0 +1,90 @@ +% arara: pdflatex: {shell: yes, files: [latexindent]} +\section{Introduction} + +\subsection{Thanks} + I first created \texttt{latexindent.pl} to help me format chapter files in a big project. + After I blogged about it on the \TeX{} stack exchange \cite{cmhblog} I received some positive feedback and follow-up feature requests. + A big thank you to Harish Kumar \cite{harish} who helped to develop and test the initial versions of the script. + + The \texttt{YAML}-based interface of \texttt{latexindent.pl} was inspired by the wonderful \texttt{arara} tool; any similarities are deliberate, and I hope that it is perceived as the compliment that it is. + Thank you to Paulo Cereda and the team for releasing this awesome tool; I initially worried that I was going to have to make a GUI for \texttt{latexindent.pl}, but the release of \texttt{arara} has meant there is no need. + + There have been several contributors to the project so far (and hopefully more in the future! + ); thank you very much to the people detailed in \vref{sec:contributors} + for their valued contributions, and thank you to those who report bugs and request features + at \cite{latexindent-home}. + +\subsection{License} + \texttt{latexindent.pl} is free and open source, and it always will be; it is released under the GNU General Public License v3.0. + + Before you start using it on any important files, bear in mind that \texttt{latexindent.pl} has the option to overwrite your \texttt{.tex} files. + It will always make at least one backup (you can choose how many it makes, see \cpageref{page:onlyonebackup}) but you should still be careful when using it. + The script has been tested on many files, but there are some known limitations (see \cref{sec:knownlimitations}). + You, the user, are responsible for ensuring that you maintain backups of your files before running \texttt{latexindent.pl} on them. + I think it is important at this stage to restate an important part of the license here: \begin{quote}\itshape This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + \end{quote} + There is certainly no malicious intent in releasing this script, and I do hope that it works as you expect it to; if it does not, please first of all make sure that you have the correct settings, and then feel free to let me know at \cite{latexindent-home} with a complete minimum working example as I would like to improve the code as much as possible. + \begin{warning} + Before you try the script on anything important (like your thesis), test it out on the sample files in the \texttt{test-case} directory \cite{latexindent-home}. + \end{warning} + + \emph{If you have used any version 2.* of \texttt{latexindent.pl}, there + are a few changes to the interface; see \vref{app:differences} and the comments + throughout this document for details}. + +\subsection{About this documentation} + As you read through this documentation, you will see many listings; in this version of the documentation, there are a total of \totallstlistings. + This may seem a lot, but I deem it necessary in presenting the various different options of \texttt{latexindent.pl} and the associated output that they are capable of producing. + + The different listings are presented using different styles: + + \begin{minipage}{.4\textwidth} + \cmhlistingsfromfile{demonstrations/demo-tex.tex}{\texttt{demo-tex.tex}}{lst:demo-tex} + \end{minipage} \hfill + \begin{minipage}{.4\textwidth} + This type of listing is a \texttt{.tex} file. + % + \end{minipage}% + + \begin{minipage}{.4\textwidth} + \cmhlistingsfromfile[style=fileExtensionPreference]*{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{fileExtensionPreference}}{lst:fileExtensionPreference-demo} + \end{minipage}% + \hfill + \begin{minipage}{.4\textwidth} + This type of listing is a \texttt{.yaml} file; when you see line numbers given (as here) it means that the snippet is taken directly from \texttt{defaultSettings.yaml}, discussed in detail in \vref{sec:defuseloc}. + \end{minipage}% + + \begin{minipage}{.55\textwidth} + \cmhlistingsfromfile[style=modifylinebreaks]*{../defaultSettings.yaml}[MLB-TCB,width=.85\linewidth,before=\centering]{\texttt{modifyLineBreaks}}{lst:modifylinebreaks-demo} + \end{minipage}% + \hfill + \begin{minipage}{.4\textwidth} + This type of listing is a \texttt{.yaml} file, but it will only be relevant when the \texttt{-m} switch is active; see \vref{sec:modifylinebreaks} for more details. + \end{minipage}% + + You will occasionally see dates shown in the margin (for example, next to this paragraph! + ) + \announce{2017-06-25}{announce} which detail the date of the version in which the feature was implemented; + the `N' stands for `new as of the date shown' and `U' stands for `updated as of the date shown'. + If you see \stardemo, it means that the feature is either new (N) or updated (U) as of the release of the current version; if you see \stardemo\, attached to a listing, then it means that listing is new (N) or updated (U) as of the current version. + If you have not read this document before (and even if you have! + ), then you can ignore every occurrence of the \stardemo; + they are simply there to highlight new and updated features. + The new and updated features in this documentation (\gitRel) are on the following pages: \listOfNewFeatures + +\subsection{Quick start} + \label{sec:quickstart} If you'd like to get started with \texttt{latexindent.pl} then simply type \begin{commandshell} +latexindent.pl myfile.tex + \end{commandshell} from the command line. + If you receive an error message such as that given in \cref{lst:poss-errors}, then you need to install the missing perl modules. + \begin{cmhlistings}[style=tcblatex,language=Perl]{Possible error messages}{lst:poss-errors} +Can't locate File/HomeDir.pm in @INC (@INC contains: /Library/Perl/5.12/darwin-thread-multi-2level /Library/Perl/5.12 /Network/Library/Perl/5.12/darwin-thread-multi-2level /Network/Library/Perl/5.12 /Library/Perl/Updates/5.12.4/darwin-thread-multi-2level /Library/Perl/Updates/5.12.4 /System/Library/Perl/5.12/darwin-thread-multi-2level /System/Library/Perl/5.12 /System/Library/Perl/Extras/5.12/darwin-thread-multi-2level /System/Library/Perl/Extras/5.12 .) at helloworld.pl line 10. +BEGIN failed--compilation aborted at helloworld.pl line 10. +\end{cmhlistings} + \texttt{latexindent.pl} ships with a script to help with this process; if you run the following script, you should be prompted + to install the appropriate modules. + \begin{commandshell} +perl latexindent-module-installer.pl + \end{commandshell} + You might also like to see \href{https://stackoverflow.com/questions/19590042/error-cant-locate-file-homedir-pm-in-inc}{https://stackoverflow.com/questions/19590042/error-cant-locate-file-homedir-pm-in-inc}, for example, as well as \vref{sec:requiredmodules}. diff --git a/test-cases/documentation/sec-the-m-switch-mod1.tex b/test-cases/documentation/sec-the-m-switch-mod1.tex new file mode 100644 index 00000000..ebe51fdc --- /dev/null +++ b/test-cases/documentation/sec-the-m-switch-mod1.tex @@ -0,0 +1,975 @@ +% arara: pdflatex: {shell: yes, files: [latexindent]} +\fancyhead[R]{\bfseries\thepage% + \tikz[remember picture,overlay] { + \node at (1,0){\includegraphics{logo}}; + }} +\section{The \texttt{-m} (\texttt{modifylinebreaks}) switch} + \label{sec:modifylinebreaks} + All features described in this section will only be relevant if the \texttt{-m} switch is used. + + \startcontents[the-m-switch] + \printcontents[the-m-switch]{}{0}{} + +\yamltitle{modifylinebreaks}*{fields} + \begin{wrapfigure}[7]{r}[0pt]{8cm} + \cmhlistingsfromfile[style=modifylinebreaks]*{../defaultSettings.yaml}[MLB-TCB,width=.85\linewidth,before=\centering]{\texttt{modifyLineBreaks}}{lst:modifylinebreaks} + \end{wrapfigure} + \makebox[0pt][r]{% + \raisebox{-\totalheight}[0pt][0pt]{% + \tikz\node[opacity=1] at (0,0) {\includegraphics[width=4cm]{logo}};}}% + As of Version 3.0, \texttt{latexindent.pl} has the \texttt{-m} switch, which permits \texttt{latexindent.pl} to modify line breaks, according to the specifications in the \texttt{modifyLineBreaks} field. + \emph{The settings + in this field will only be considered if the \texttt{-m} switch has been used}. + A snippet of the default settings of this field is shown in \cref{lst:modifylinebreaks}. + + Having read the previous paragraph, it should sound reasonable that, if you call \texttt{latexindent.pl} using the \texttt{-m} switch, then you give it permission to modify line breaks in your file, but let's be clear: + + \begin{warning} If you call \texttt{latexindent.pl} with the \texttt{-m} switch, then you are giving it permission to modify line breaks. + By default, the only thing that will happen is that multiple blank lines will be condensed into one blank line; many other settings are possible, discussed next. + \end{warning} + +\yamltitle{preserveBlankLines}{0|1} + This field is directly related to \emph{poly-switches}, discussed below. + By default, it is set to \texttt{1}, which means that blank lines will be protected from removal; however, regardless of this setting, multiple blank lines can be condensed if \texttt{condenseMultipleBlankLinesInto} is greater than \texttt{0}, discussed next. + +\yamltitle{condenseMultipleBlankLinesInto}*{integer $\geq 0$} + Assuming that this switch takes an integer value greater than \texttt{0}, \texttt{latexindent.pl} will condense multiple blank lines into the number of blank lines illustrated by this switch. + As an example, \cref{lst:mlb-bl} shows a sample file with blank lines; upon running \begin{commandshell} +latexindent.pl myfile.tex -m +\end{commandshell} the output is shown in \cref{lst:mlb-bl-out}; note that the multiple blank lines have been condensed into one blank line, and note also that we have used the \texttt{-m} switch! + + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile{demonstrations/mlb1.tex}{\texttt{mlb1.tex}}{lst:mlb-bl} + \end{minipage}% + \hfill + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile{demonstrations/mlb1-out.tex}{\texttt{mlb1.tex} out output}{lst:mlb-bl-out} + \end{minipage} + +\yamltitle{textWrapOptions}*{fields} + When the \texttt{-m} switch is active \texttt{latexindent.pl} has the ability to wrap text using the options% + \announce{2017-05-27}{textWrapOptions} specified in the \texttt{textWrapOptions} field, see \cref{lst:textWrapOptions}. + The value of \texttt{columns} specifies the column at which the text should be wrapped. + By default, the value of \texttt{columns} is \texttt{0}, so \texttt{latexindent.pl} will \emph{not} wrap text; if you change it to a value of \texttt{2} or more, then text will be wrapped after the character in the specified column. + + \cmhlistingsfromfile[style=textWrapOptions]*{../defaultSettings.yaml}[MLB-TCB,width=.85\linewidth,before=\centering]{\texttt{textWrapOptions}}{lst:textWrapOptions} + + For example, consider the file give in \cref{lst:textwrap1}. + + \begin{widepage} + \cmhlistingsfromfile{demonstrations/textwrap1.tex}{\texttt{textwrap1.tex}}{lst:textwrap1} + \end{widepage} + + Using the file \texttt{textwrap1.yaml} in \cref{lst:textwrap1-yaml}, and running the command \begin{commandshell} +latexindent.pl -m textwrap1.tex -o textwrap1-mod1.tex -l textwrap1.yaml +\end{commandshell} we obtain the output in \cref{lst:textwrap1-mod1}. + + \begin{minipage}{.45\linewidth} + \cmhlistingsfromfile{demonstrations/textwrap1-mod1.tex}{\texttt{textwrap1-mod1.tex}}{lst:textwrap1-mod1} + \end{minipage} + \hfill + \begin{minipage}{.45\linewidth} + \cmhlistingsfromfile{demonstrations/textwrap1.yaml}[MLB-TCB]{\texttt{textwrap1.yaml}}{lst:textwrap1-yaml} + \end{minipage} + + The text wrapping routine is performed \emph{after} verbatim environments have been stored, so verbatim environments and verbatim commands are exempt from the routine. + For example, using the file in \cref{lst:textwrap2}, \begin{widepage} \cmhlistingsfromfile{demonstrations/textwrap2.tex}{\texttt{textwrap2.tex}}{lst:textwrap2} \end{widepage} and running the following command and continuing to use \texttt{textwrap1.yaml} from \cref{lst:textwrap1-yaml}, \begin{commandshell} +latexindent.pl -m textwrap2.tex -o textwrap2-mod1.tex -l textwrap1.yaml +\end{commandshell} then the output is as in \cref{lst:textwrap2-mod1}. + \begin{widepage} + \cmhlistingsfromfile{demonstrations/textwrap2-mod1.tex}{\texttt{textwrap2-mod1.tex}}{lst:textwrap2-mod1} + \end{widepage} + Furthermore, the text wrapping routine is performed after the trailing comments have been stored, and they are also exempt from text wrapping. + For example, using the file in \cref{lst:textwrap3} \begin{widepage} \cmhlistingsfromfile{demonstrations/textwrap3.tex}{\texttt{textwrap3.tex}}{lst:textwrap3} \end{widepage} and running the following command and continuing to use \texttt{textwrap1.yaml} from \cref{lst:textwrap1-yaml}, \begin{commandshell} +latexindent.pl -m textwrap3.tex -o textwrap3-mod1.tex -l textwrap1.yaml +\end{commandshell} then the output is as in \cref{lst:textwrap3-mod1}. + + \cmhlistingsfromfile{demonstrations/textwrap3-mod1.tex}{\texttt{textwrap3-mod1.tex}}{lst:textwrap3-mod1} + + \begin{wrapfigure}[6]{r}[0pt]{8cm} + \cmhlistingsfromfile[style=textWrapOptionsAll]*{../defaultSettings.yaml}[MLB-TCB,width=.85\linewidth,before=\centering]{\texttt{textWrapOptions}}{lst:textWrapOptionsAll} + \end{wrapfigure} + The text wrapping routine of \texttt{latexindent.pl} is performed by the \texttt{Text::Wrap} module, which provides a \texttt{separator} feature to separate lines with characters other than a new line (see \cite{textwrap}). + By default, the separator is empty (see \cref{lst:textWrapOptionsAll}) which means that a new line token will be used, but you can change it as you see fit. + + For example starting with the file in \cref{lst:textwrap4} + + \cmhlistingsfromfile{demonstrations/textwrap4.tex}{\texttt{textwrap4.tex}}{lst:textwrap4} and using \texttt{textwrap2.yaml} from \cref{lst:textwrap2-yaml} with the following command \begin{commandshell} +latexindent.pl -m textwrap4.tex -o textwrap4-mod2.tex -l textwrap2.yaml +\end{commandshell} then we obtain the output in \cref{lst:textwrap4-mod2}. + + \begin{minipage}{.45\linewidth} + \cmhlistingsfromfile{demonstrations/textwrap4-mod2.tex}{\texttt{textwrap4-mod2.tex}}{lst:textwrap4-mod2} + \end{minipage} + \hfill + \begin{minipage}{.45\linewidth} + \cmhlistingsfromfile{demonstrations/textwrap2.yaml}[MLB-TCB]{\texttt{textwrap2.yaml}}{lst:textwrap2-yaml} + \end{minipage} + + \paragraph{Summary of text wrapping} + It is important to note the following: \begin{itemize} \item Verbatim environments (\vref{lst:verbatimEnvironments}) and verbatim commands (\vref{lst:verbatimCommands}) will \emph{not} be affected by the text wrapping routine (see \vref{lst:textwrap2-mod1}); + \item comments will \emph{not} be affected by the text wrapping routine (see \vref{lst:textwrap3-mod1}); + \item indentation is performed \emph{after} the text wrapping routine; as such, indented code will likely exceed any maximum value set in the \texttt{columns} field. + \end{itemize} + +\subsection{\texttt{oneSentencePerLine}: modifying line breaks for sentences} + \label{sec:onesentenceperline} + You can instruct \texttt{latexindent.pl} to format \announce*{2018-01-13}{one sentence per line} your file so that it puts one sentence per line. + % + Thank you to \cite{mlep} for helping to shape and test this feature. + The behaviour of this part of the script is controlled by the switches detailed in \cref{lst:oneSentencePerLine}, all of which we discuss next. + + \cmhlistingsfromfile*[style=oneSentencePerLine]*{../defaultSettings.yaml}[MLB-TCB,width=.85\linewidth,before=\centering]{\texttt{oneSentencePerLine}}{lst:oneSentencePerLine} + +\yamltitle{manipulateSentences}{0|1} + This is a binary switch that details if \texttt{latexindent.pl} should perform the sentence manipulation routine; it is \emph{off} (set to \texttt{0}) by default, and you will need to turn it on (by setting it to \texttt{1}) if you want the script to modify line breaks surrounding and within sentences. + +\yamltitle{removeSentenceLineBreaks}{0|1} + When operating upon sentences \texttt{latexindent.pl} will, by default, remove internal linebreaks as \texttt{removeSentenceLineBreaks} is set to \texttt{1}. + Setting this switch to \texttt{0} instructs \texttt{latexindent.pl} not to do so. + + For example, consider \texttt{multiple-sentences.tex} shown in \cref{lst:multiple-sentences}. + + \cmhlistingsfromfile*{demonstrations/multiple-sentences.tex}{\texttt{multiple-sentences.tex}}{lst:multiple-sentences} + + If we use the YAML files in \cref{lst:manipulate-sentences-yaml,lst:keep-sen-line-breaks-yaml}, and run the commands \begin{widepage} \begin{commandshell} +latexindent.pl multiple-sentences -m -l=manipulate-sentences.yaml +latexindent.pl multiple-sentences -m -l=keep-sen-line-breaks.yaml + \end{commandshell} \end{widepage} then we obtain the respective output given in \cref{lst:multiple-sentences-mod1,lst:multiple-sentences-mod2}. + + \begin{minipage}{.5\linewidth} + \cmhlistingsfromfile*{demonstrations/multiple-sentences-mod1.tex}{\texttt{multiple-sentences.tex} using \cref{lst:manipulate-sentences-yaml}}{lst:multiple-sentences-mod1} + \end{minipage} + \hfill + \begin{minipage}{.5\linewidth} + \cmhlistingsfromfile*[style=yaml-LST]*{demonstrations/manipulate-sentences.yaml}[MLB-TCB]{\texttt{manipulate-sentences.yaml}}{lst:manipulate-sentences-yaml} + \end{minipage} + + \begin{minipage}{.5\linewidth} + \cmhlistingsfromfile*{demonstrations/multiple-sentences-mod2.tex}{\texttt{multiple-sentences.tex} using \cref{lst:keep-sen-line-breaks-yaml}}{lst:multiple-sentences-mod2} + \end{minipage} + \hfill + \begin{minipage}{.5\linewidth} + \cmhlistingsfromfile*[style=yaml-LST]*{demonstrations/keep-sen-line-breaks.yaml}[MLB-TCB]{\texttt{keep-sen-line-breaks.yaml}}{lst:keep-sen-line-breaks-yaml} + \end{minipage} + + Notice, in particular, that the `internal' sentence line breaks in \cref{lst:multiple-sentences} have been removed in \cref{lst:multiple-sentences-mod1}, but have not been removed in \cref{lst:multiple-sentences-mod2}. + + The remainder of the settings displayed in \vref{lst:oneSentencePerLine} instruct \texttt{latexindent.pl} on how to define a sentence. + From the perpesctive of \texttt{latexindent.pl} a sentence must: \begin{itemize} \item \emph{follow} a certain character or set of characters (see \cref{lst:sentencesFollow}); by default, this is either \lstinline!\par!, a blank line, a full stop/period (.) + , exclamation mark (!), question mark (?) right brace (\}) or a comment + on the previous line; + \item \emph{begin} with a character type (see \cref{lst:sentencesBeginWith}); by default, this is only capital letters; + \item \emph{end} with a character (see \cref{lst:sentencesEndWith}); by default, these are + full stop/period (.), exclamation mark (!) and question mark (?). + \end{itemize} + In each case, you can specify the \texttt{other} field to include any pattern that you would like; you can specify anything in this field using the language of regular expressions. + + \begin{adjustwidth}{-3.5cm}{-2.5cm} + \begin{minipage}{.36\linewidth} + \cmhlistingsfromfile*[style=sentencesFollow]*{../defaultSettings.yaml}[MLB-TCB,width=.9\linewidth,before=\centering]{\texttt{sentencesFollow}}{lst:sentencesFollow} + \end{minipage} + \hfill + \begin{minipage}{.31\linewidth} + \cmhlistingsfromfile*[style=sentencesBeginWith]*{../defaultSettings.yaml}[MLB-TCB,width=.9\linewidth,before=\centering]{\texttt{sentencesBeginWith}}{lst:sentencesBeginWith} + \end{minipage} + \hfill + \begin{minipage}{.31\linewidth} + \cmhlistingsfromfile*[style=sentencesEndWith]*{../defaultSettings.yaml}[MLB-TCB,width=.9\linewidth,before=\centering]{\texttt{sentencesEndWith}}{lst:sentencesEndWith} + \end{minipage} + \end{adjustwidth} + +\subsubsection{\texttt{sentencesFollow}} + Let's explore a few of the switches in \texttt{sentencesFollow}; let's start with \vref{lst:multiple-sentences}, and use the YAML settings given in \cref{lst:sentences-follow1-yaml}. + Using the command \begin{commandshell} +latexindent.pl multiple-sentences -m -l=sentences-follow1.yaml +\end{commandshell} we obtain the output given in \cref{lst:multiple-sentences-mod3}. + + \begin{minipage}{.5\linewidth} + \cmhlistingsfromfile*{demonstrations/multiple-sentences-mod3.tex}{\texttt{multiple-sentences.tex} using \cref{lst:sentences-follow1-yaml}}{lst:multiple-sentences-mod3} + \end{minipage} + \hfill + \begin{minipage}{.5\linewidth} + \cmhlistingsfromfile*[style=yaml-LST]*{demonstrations/sentences-follow1.yaml}[MLB-TCB]{\texttt{sentences-follow1.yaml}}{lst:sentences-follow1-yaml} + \end{minipage} + + Notice that, because \texttt{blankLine} is set to \texttt{0}, \texttt{latexindent.pl} will not seek sentences following a blank line, and so the fourth sentence has not been accounted for. + + We can explore the \texttt{other} field in \cref{lst:sentencesFollow} with the \texttt{.tex} file detailed in \cref{lst:multiple-sentences1}. + + \cmhlistingsfromfile*{demonstrations/multiple-sentences1.tex}{\texttt{multiple-sentences1.tex}}{lst:multiple-sentences1} + + Upon running the following commands \begin{widepage} \begin{commandshell} +latexindent.pl multiple-sentences1 -m -l=manipulate-sentences.yaml +latexindent.pl multiple-sentences1 -m -l=manipulate-sentences.yaml,sentences-follow2.yaml + \end{commandshell} \end{widepage} then we obtain the respective output given in \cref{lst:multiple-sentences1-mod1,lst:multiple-sentences1-mod2}. + \cmhlistingsfromfile*{demonstrations/multiple-sentences1-mod1.tex}{\texttt{multiple-sentences1.tex} using \vref{lst:manipulate-sentences-yaml}}{lst:multiple-sentences1-mod1} + + \begin{minipage}{.55\linewidth} + \cmhlistingsfromfile*{demonstrations/multiple-sentences1-mod2.tex}{\texttt{multiple-sentences1.tex} using \cref{lst:sentences-follow2-yaml}}{lst:multiple-sentences1-mod2} + \end{minipage} + \hfill + \begin{minipage}{.45\linewidth} + \cmhlistingsfromfile*[style=yaml-LST]*{demonstrations/sentences-follow2.yaml}[MLB-TCB]{\texttt{sentences-follow2.yaml}}{lst:sentences-follow2-yaml} + \end{minipage} + + Notice that in \cref{lst:multiple-sentences1-mod1} the first sentence after the \texttt{)} has not been accounted for, but that following the inclusion of \cref{lst:sentences-follow2-yaml}, the output given in \cref{lst:multiple-sentences1-mod2} demonstrates that the sentence \emph{has} been accounted for correctly. + +\subsubsection{\texttt{sentencesBeginWith}} + By default, \texttt{latexindent.pl} will only assume that sentences begin with the upper case letters \texttt{A-Z}; you can instruct the script to define sentences to begin with lower case letters (see \cref{lst:sentencesBeginWith}), and we can use the \texttt{other} field to define sentences to begin with other characters. + + \cmhlistingsfromfile*{demonstrations/multiple-sentences2.tex}{\texttt{multiple-sentences2.tex}}{lst:multiple-sentences2} + + Upon running the following commands \begin{widepage} \begin{commandshell} +latexindent.pl multiple-sentences2 -m -l=manipulate-sentences.yaml +latexindent.pl multiple-sentences2 -m -l=manipulate-sentences.yaml,sentences-begin1.yaml + \end{commandshell} \end{widepage} then we obtain the respective output given in \cref{lst:multiple-sentences2-mod1,lst:multiple-sentences2-mod2}. + \cmhlistingsfromfile*{demonstrations/multiple-sentences2-mod1.tex}{\texttt{multiple-sentences2.tex} using \vref{lst:manipulate-sentences-yaml}}{lst:multiple-sentences2-mod1} + + \begin{minipage}{.55\linewidth} + \cmhlistingsfromfile*{demonstrations/multiple-sentences2-mod2.tex}{\texttt{multiple-sentences2.tex} using \cref{lst:sentences-begin1-yaml}}{lst:multiple-sentences2-mod2} + \end{minipage} + \hfill + \begin{minipage}{.45\linewidth} + \cmhlistingsfromfile*[style=yaml-LST]*{demonstrations/sentences-begin1.yaml}[MLB-TCB]{\texttt{sentences-begin1.yaml}}{lst:sentences-begin1-yaml} + \end{minipage} + Notice that in \cref{lst:multiple-sentences2-mod1}, the first sentence has been accounted for but that the subsequent sentences have not. + In \cref{lst:multiple-sentences2-mod2}, all of the sentences have been accounted for, because the \texttt{other} field in \cref{lst:sentences-begin1-yaml} has defined sentences to begin with either \lstinline!$! or any numeric digit, \texttt{0} to \texttt{9}. + +\subsubsection{\texttt{sentencesEndWith}} + Let's return to \vref{lst:multiple-sentences}; we have already seen the default way in which \texttt{latexindent.pl} will operate on the sentences in this file in \vref{lst:multiple-sentences-mod1}. + We can populate the \texttt{other} field with any character that we wish; for example, using the YAML specified in \cref{lst:sentences-end1-yaml} and the command \begin{commandshell} +latexindent.pl multiple-sentences -m -l=sentences-end1.yaml +latexindent.pl multiple-sentences -m -l=sentences-end2.yaml +\end{commandshell} then we obtain the output in \cref{lst:multiple-sentences-mod4}. + + \begin{minipage}{.5\linewidth} + \cmhlistingsfromfile*{demonstrations/multiple-sentences-mod4.tex}{\texttt{multiple-sentences.tex} using \cref{lst:sentences-end1-yaml}}{lst:multiple-sentences-mod4} + \end{minipage} + \hfill + \begin{minipage}{.5\linewidth} + \cmhlistingsfromfile*[style=yaml-LST]*{demonstrations/sentences-end1.yaml}[MLB-TCB]{\texttt{sentences-end1.yaml}}{lst:sentences-end1-yaml} + \end{minipage} + + \begin{minipage}{.5\linewidth} + \cmhlistingsfromfile*{demonstrations/multiple-sentences-mod5.tex}{\texttt{multiple-sentences.tex} using \cref{lst:sentences-end2-yaml}}{lst:multiple-sentences-mod5} + \end{minipage} + \hfill + \begin{minipage}{.5\linewidth} + \cmhlistingsfromfile*[style=yaml-LST]*{demonstrations/sentences-end2.yaml}[MLB-TCB]{\texttt{sentences-end2.yaml}}{lst:sentences-end2-yaml} + \end{minipage} + + There is a subtle difference between the output in \cref{lst:multiple-sentences-mod4,lst:multiple-sentences-mod5}; in particular, in \cref{lst:multiple-sentences-mod4} the word \texttt{sentence} has not been defined as a sentence, because we have not instructed \texttt{latexindent.pl} to begin sentences with lower case letters. + We have changed this by using the settings in \cref{lst:sentences-end2-yaml}, and the associated output in \cref{lst:multiple-sentences-mod5} reflects this. + + Referencing \vref{lst:sentencesEndWith}, you'll notice that there is a field called \texttt{basicFullStop}, which is set to \texttt{0}, and that the \texttt{betterFullStop} is set to \texttt{1} by default. + + Let's consider the file shown in \cref{lst:url}. + + \cmhlistingsfromfile*{demonstrations/url.tex}{\texttt{url.tex}}{lst:url} + + Upon running the following commands \begin{commandshell} +latexindent.pl url -m -l=manipulate-sentences.yaml +\end{commandshell} we obtain the output given in \cref{lst:url-mod1}. + + \cmhlistingsfromfile*{demonstrations/url-mod1.tex}{\texttt{url.tex} using \vref{lst:manipulate-sentences-yaml}}{lst:url-mod1} + + Notice that the full stop within the url has been interpreted correctly. + This is because, within the \texttt{betterFullStop}, full stops at the end of sentences have the following properties: \begin{itemize} \item they are ignored within \texttt{e.g.} and \texttt{i.e.}; + \item they can not be immediately followed by a lower case or upper case letter; + \item they can not be immediately followed by a hyphen, comma, or number. + \end{itemize} + If you find that the \texttt{betterFullStop} does not work for your purposes, then you can switch it off by setting it to \texttt{0}, and you can experiment with the \texttt{other} field. + + The \texttt{basicFullStop} routine should probably be avoided in most situations, as it does not accomodate the specifications above. + For example, using the YAML in \cref{lst:alt-full-stop1-yaml} gives the output from the following command in \cref{lst:url-mod2}. + \begin{commandshell} +latexindent.pl url -m -l=alt-full-stop1.yaml +\end{commandshell} + + \begin{adjustwidth}{-3.5cm}{-1.5cm} + \begin{minipage}{.6\linewidth} + \cmhlistingsfromfile*{demonstrations/url-mod2.tex}{\texttt{url.tex} using \cref{lst:alt-full-stop1-yaml}}{lst:url-mod2} + \end{minipage} + \hfill + \begin{minipage}{.4\linewidth} + \cmhlistingsfromfile*[style=yaml-LST]*{demonstrations/alt-full-stop1.yaml}[MLB-TCB]{\texttt{alt-full-stop1.yaml}}{lst:alt-full-stop1-yaml} + \end{minipage} + \end{adjustwidth} + + Notice that the full stop within the URL has not been accomodated correctly because of the non-default settings in \cref{lst:alt-full-stop1-yaml}. + +\subsubsection{Features of the \texttt{oneSentencePerLine} routine} + The sentence manipulation routine takes place \emph{after} verbatim environments, preamble and trailing comments have been accounted for; this means that any characters within these types of code blocks will not be part of the sentence manipulation routine. + + For example, if we begin with the \texttt{.tex} file in \cref{lst:multiple-sentences3}, and run the command \begin{commandshell} +latexindent.pl multiple-sentences3 -m -l=manipulate-sentences.yaml + \end{commandshell} then we obtain the output in \cref{lst:multiple-sentences3-mod1}. + \cmhlistingsfromfile*{demonstrations/multiple-sentences3.tex}{\texttt{multiple-sentences3.tex}}{lst:multiple-sentences3} + \cmhlistingsfromfile*{demonstrations/multiple-sentences3-mod1.tex}{\texttt{multiple-sentences3.tex} using \vref{lst:manipulate-sentences-yaml}}{lst:multiple-sentences3-mod1} + + Furthermore, if sentences run across environments then, by default, the line breaks internal to the sentence will be removed. + For example, if we use the \texttt{.tex} file in \cref{lst:multiple-sentences4} and run the commands \begin{commandshell} +latexindent.pl multiple-sentences4 -m -l=manipulate-sentences.yaml +latexindent.pl multiple-sentences4 -m -l=keep-sen-line-breaks.yaml + \end{commandshell} then we obtain the output in \cref{lst:multiple-sentences4-mod1,lst:multiple-sentences4-mod2}. + \cmhlistingsfromfile*{demonstrations/multiple-sentences4.tex}{\texttt{multiple-sentences4.tex}}{lst:multiple-sentences4} + \begin{widepage} + \cmhlistingsfromfile*{demonstrations/multiple-sentences4-mod1.tex}{\texttt{multiple-sentences4.tex} using \vref{lst:manipulate-sentences-yaml}}{lst:multiple-sentences4-mod1} + \end{widepage} + \cmhlistingsfromfile*{demonstrations/multiple-sentences4-mod2.tex}{\texttt{multiple-sentences4.tex} using \vref{lst:keep-sen-line-breaks-yaml}}{lst:multiple-sentences4-mod2} + Once you've read \cref{sec:poly-switches}, you will know that you can accomodate the removal of internal sentence line breaks by using the YAML in \cref{lst:item-rules2-yaml} and the command \begin{commandshell} +latexindent.pl multiple-sentences4 -m -l=item-rules2.yaml + \end{commandshell} the output of which is shown in \cref{lst:multiple-sentences4-mod3}. + + \begin{minipage}{.5\linewidth} + \cmhlistingsfromfile*{demonstrations/multiple-sentences4-mod3.tex}{\texttt{multiple-sentences4.tex} using \cref{lst:item-rules2-yaml}}{lst:multiple-sentences4-mod3} + \end{minipage} + \hfill + \begin{minipage}{.5\linewidth} + \cmhlistingsfromfile*[style=yaml-LST]*{demonstrations/item-rules2.yaml}[MLB-TCB]{\texttt{item-rules2.yaml}}{lst:item-rules2-yaml} + \end{minipage} + +\subsection{\texttt{removeParagraphLineBreaks}: modifying line breaks for paragraphs} + When the \texttt{-m} switch is active \texttt{latexindent.pl} has the ability to remove line breaks% + \announce{2017-05-27}{removeParagraphLineBreaks} from within paragraphs; the behaviour is controlled by the \texttt{removeParagraphLineBreaks} field, detailed in \cref{lst:removeParagraphLineBreaks}. + Thank you to \cite{jowens} for shaping and assisting with the testing of this feature. +\yamltitle{removeParagraphLineBreaks}*{fields} + This feature is considered complimentary to the \texttt{oneSentencePerLine} feature described in \vref{sec:onesentenceperline}. + + \cmhlistingsfromfile[style=removeParagraphLineBreaks]*{../defaultSettings.yaml}[MLB-TCB,width=.85\linewidth,before=\centering]{\texttt{removeParagraphLineBreaks}}{lst:removeParagraphLineBreaks} + + This routine can be turned on \emph{globally} for \emph{every} code block type known to \texttt{latexindent.pl} (see \vref{tab:code-blocks}) by using the \texttt{all} switch; by default, this switch is \emph{off}. + Assuming that the \texttt{all} switch is off, then the routine can be controlled on a per-code-block-type basis, and within that, on a per-name basis. + We will consider examples of each of these in turn, but before we do, let's specify what \texttt{latexindent.pl} considers as a paragraph: \begin{itemize} \item it must begin on its own line with either an alphabetic or numeric character, and not with any of the code-block types detailed in \vref{tab:code-blocks}; + \item it can include line breaks, but finishes when it meets either a blank line, a \lstinline!\par! command, or any of the user-specified settings in the \texttt{paragraphsStopAt} field, detailed in \vref{lst:paragraphsStopAt}. + \end{itemize} + + Let's start with the \texttt{.tex} file in \cref{lst:shortlines}, together with the YAML settings in \cref{lst:remove-para1-yaml}. + + \begin{minipage}{.45\linewidth} + \cmhlistingsfromfile[showspaces=true]{demonstrations/shortlines.tex}{\texttt{shortlines.tex}}{lst:shortlines} + \end{minipage} + \hfill + \begin{minipage}{.49\linewidth} + \cmhlistingsfromfile{demonstrations/remove-para1.yaml}[MLB-TCB]{\texttt{remove-para1.yaml}}{lst:remove-para1-yaml} + \end{minipage} + + Upon running the command \begin{commandshell} +latexindent.pl -m shortlines.tex -o shortlines1.tex -l remove-para1.yaml +\end{commandshell} then we obtain the output given in \cref{lst:shortlines1}. + + \cmhlistingsfromfile[showspaces=true]{demonstrations/shortlines1.tex}{\texttt{shortlines1.tex}}{lst:shortlines1} + + Keen readers may notice that some trailing white space must be present in the file in \cref{lst:shortlines} which has crept in to the output in \cref{lst:shortlines1}. + This can be fixed using the YAML file in \vref{lst:removeTWS-before} and running, for example, \begin{commandshell} +latexindent.pl -m shortlines.tex -o shortlines1-tws.tex -l remove-para1.yaml,removeTWS-before.yaml + \end{commandshell} in which case the output is as in \cref{lst:shortlines1-tws}; notice that the double spaces present in \cref{lst:shortlines1} have been addressed. + + \cmhlistingsfromfile[showspaces=true]{demonstrations/shortlines1-tws.tex}{\texttt{shortlines1-tws.tex}}{lst:shortlines1-tws} + + Keeping with the settings in \cref{lst:remove-para1-yaml}, we note that the \texttt{all} switch applies to \emph{all} code block types. + So, for example, let's consider the files in \cref{lst:shortlines-mand,lst:shortlines-opt} + + \begin{minipage}{.45\linewidth} + \cmhlistingsfromfile{demonstrations/shortlines-mand.tex}{\texttt{shortlines-mand.tex}}{lst:shortlines-mand} + \end{minipage} \hfill + \begin{minipage}{.45\linewidth} + \cmhlistingsfromfile{demonstrations/shortlines-opt.tex}{\texttt{shortlines-opt.tex}}{lst:shortlines-opt} + \end{minipage} + + Upon running the commands \begin{widepage} \begin{commandshell} +latexindent.pl -m shortlines-mand.tex -o shortlines-mand1.tex -l remove-para1.yaml +latexindent.pl -m shortlines-opt.tex -o shortlines-opt1.tex -l remove-para1.yaml +\end{commandshell} \end{widepage} + + then we obtain the respective output given in \cref{lst:shortlines-mand1,lst:shortlines-opt1}. + + \cmhlistingsfromfile{demonstrations/shortlines-mand1.tex}{\texttt{shortlines-mand1.tex}}{lst:shortlines-mand1} + \cmhlistingsfromfile{demonstrations/shortlines-opt1.tex}{\texttt{shortlines-opt1.tex}}{lst:shortlines-opt1} + + Assuming that we turn \emph{off} the \texttt{all} switch (by setting it to \texttt{0}), then we can control the behaviour of \texttt{removeParagraphLineBreaks} either on a per-code-block-type basis, or on a per-name basis. + + For example, let's use the code in \cref{lst:shortlines-envs}, and consider the settings in \cref{lst:remove-para2-yaml,lst:remove-para3-yaml}; note that in \cref{lst:remove-para2-yaml} we specify that \emph{every} environment should receive treatment from the routine, while in \cref{lst:remove-para3-yaml} we specify that \emph{only} the \texttt{one} environment should receive the treatment. + + \begin{minipage}{.45\linewidth} + \cmhlistingsfromfile{demonstrations/shortlines-envs.tex}{\texttt{shortlines-envs.tex}}{lst:shortlines-envs} + \end{minipage} + \hfill + \begin{minipage}{.49\linewidth} + \cmhlistingsfromfile{demonstrations/remove-para2.yaml}[MLB-TCB]{\texttt{remove-para2.yaml}}{lst:remove-para2-yaml} + \cmhlistingsfromfile{demonstrations/remove-para3.yaml}[MLB-TCB]{\texttt{remove-para3.yaml}}{lst:remove-para3-yaml} + \end{minipage} + + Upon running the commands \begin{widepage} \begin{commandshell} +latexindent.pl -m shortlines-envs.tex -o shortlines-envs2.tex -l remove-para2.yaml +latexindent.pl -m shortlines-envs.tex -o shortlines-envs3.tex -l remove-para3.yaml +\end{commandshell} \end{widepage} then we obtain the respective output given in \cref{lst:shortlines-envs2,lst:shortlines-envs3}. + + \cmhlistingsfromfile{demonstrations/shortlines-envs2.tex}{\texttt{shortlines-envs2.tex}}{lst:shortlines-envs2} + \cmhlistingsfromfile{demonstrations/shortlines-envs3.tex}{\texttt{shortlines-envs3.tex}}{lst:shortlines-envs3} + + The remaining code-block types can be customized in analogous ways, although note that \texttt{commands}, \texttt{keyEqualsValuesBracesBrackets}, \texttt{namedGroupingBracesBrackets}, \texttt{UnNamedGroupingBracesBrackets} are controlled by the \texttt{optionalArguments} and the \texttt{mandatoryArguments}. + + The only special case is the \texttt{masterDocument} field; this is designed for `chapter'-type files that may contain paragraphs that are not within any other code-blocks. + For example, consider the file in \cref{lst:shortlines-md}, with the YAML settings in \cref{lst:remove-para4-yaml}. + + \begin{minipage}{.45\linewidth} + \cmhlistingsfromfile{demonstrations/shortlines-md.tex}{\texttt{shortlines-md.tex}}{lst:shortlines-md} + \end{minipage} + \hfill + \begin{minipage}{.49\linewidth} + \cmhlistingsfromfile{demonstrations/remove-para4.yaml}[MLB-TCB]{\texttt{remove-para4.yaml}}{lst:remove-para4-yaml} + \end{minipage} + + Upon running the following command \begin{widepage} \begin{commandshell} +latexindent.pl -m shortlines-md.tex -o shortlines-md4.tex -l remove-para4.yaml +\end{commandshell} \end{widepage} then we obtain the output in \cref{lst:shortlines-md4}. + \cmhlistingsfromfile{demonstrations/shortlines-md4.tex}{\texttt{shortlines-md4.tex}}{lst:shortlines-md4} + +\yamltitle{paragraphsStopAt}*{fields} + The paragraph line break routine considers blank lines and the \lstinline|\par| command to be the end of a paragraph;% + \announce{2017-05-27}{paragraphsStopAt} you can fine tune the behaviour of the routine further by using the \texttt{paragraphsStopAt} fields, shown in \cref{lst:paragraphsStopAt}. + + \cmhlistingsfromfile[style=paragraphsStopAt]*{../defaultSettings.yaml}[MLB-TCB,width=.85\linewidth,before=\centering]{\texttt{paragraphsStopAt}}{lst:paragraphsStopAt} + + The fields specified in \texttt{paragraphsStopAt} tell \texttt{latexindent.pl} to stop the current paragraph when it reaches a line that \emph{begins} with any of the code-block types specified as \texttt{1} in \cref{lst:paragraphsStopAt}. + By default, you'll see that the paragraph line break routine will stop when it reaches an environment at the beginning of a line. + It is \emph{not} possible to specify these fields on a per-name basis. + + Let's use the \texttt{.tex} file in \cref{lst:sl-stop}; we will, in turn, consider the settings in \cref{lst:stop-command-yaml,lst:stop-comment-yaml}. + + \begin{minipage}{.45\linewidth} + \cmhlistingsfromfile{demonstrations/sl-stop.tex}{\texttt{sl-stop.tex}}{lst:sl-stop} + \end{minipage} + \hfill + \begin{minipage}{.49\linewidth} + \cmhlistingsfromfile{demonstrations/stop-command.yaml}[MLB-TCB]{\texttt{stop-command.yaml}}{lst:stop-command-yaml} + + \cmhlistingsfromfile{demonstrations/stop-comment.yaml}[MLB-TCB]{\texttt{stop-comment.yaml}}{lst:stop-comment-yaml} + \end{minipage} + + Upon using the settings from \vref{lst:remove-para4-yaml} and running the commands \begin{widepage} \begin{commandshell} +latexindent.pl -m sl-stop.tex -o sl-stop4.tex -l remove-para4.yaml +latexindent.pl -m sl-stop.tex -o sl-stop4-command.tex -l=remove-para4.yaml,stop-command.yaml +latexindent.pl -m sl-stop.tex -o sl-stop4-comment.tex -l=remove-para4.yaml,stop-comment.yaml + \end{commandshell} \end{widepage} we obtain the respective outputs in \crefrange{lst:sl-stop4}{lst:sl-stop4-comment}; notice in particular that: \begin{itemize} \item in \cref{lst:sl-stop4} the paragraph line break routine has included commands and comments; + \item in \cref{lst:sl-stop4-command} the paragraph line break routine has \emph{stopped} at the \texttt{emph} command, because in \cref{lst:stop-command-yaml} we have specified \texttt{commands} to be \texttt{1}, and \texttt{emph} is at the beginning of a line; + \item in \cref{lst:sl-stop4-comment} the paragraph line break routine has \emph{stopped} at the comments, because in \cref{lst:stop-comment-yaml} we have specified \texttt{comments} to be \texttt{1}, and the comment is at the beginning of a line. + \end{itemize} + In all outputs in \crefrange{lst:sl-stop4}{lst:sl-stop4-comment} we notice that the paragraph line break routine has stopped at \lstinline!\begin{myenv}! because, by default, \texttt{environments} is set to \texttt{1} in \vref{lst:paragraphsStopAt}. + + \cmhlistingsfromfile{demonstrations/sl-stop4.tex}{\texttt{sl-stop4.tex}}{lst:sl-stop4} + \cmhlistingsfromfile{demonstrations/sl-stop4-command.tex}{\texttt{sl-stop4-command.tex}}{lst:sl-stop4-command} + \cmhlistingsfromfile{demonstrations/sl-stop4-comment.tex}{\texttt{sl-stop4-comment.tex}}{lst:sl-stop4-comment} + +\subsection{Poly-switches} + \label{sec:poly-switches} + Every other field in the \texttt{modifyLineBreaks} field uses poly-switches, and can take one of \emph{five}% + \announce{2017-08-21}*{blank line poly-switch} integer values: \begin{itemize}[font=\bfseries] + \item[$-1$] \emph{remove mode}: line breaks before or after the \emph{<part of thing>} can be removed (assuming that \texttt{preserveBlankLines} is set to \texttt{0}); + \item[0] \emph{off mode}: line breaks will not be modified for the \emph{<part of thing>} under consideration; + \item[1] \emph{add mode}: a line break will be added before or after the \emph{<part of thing>} under consideration, assuming that there is not already a line break before or after the \emph{<part of thing>}; + \item[2] \emph{comment then add mode}: a comment symbol will be added, followed by a line break before or after the \emph{<part of thing>} under consideration, assuming that there is not already a comment and line break before or after the \emph{<part of thing>}; + \item[3] \emph{add then blank line mode}% + \announce{2017-08-21}{blank line poly-switch}: a line break will be added before or after the \emph{<part of thing>} under consideration, assuming that there is not already a line break before or after the \emph{<part of thing>}, followed by a blank line. + %% + \end{itemize} + In the above, \emph{<part of thing>} refers to either the \emph{begin statement}, \emph{body} or \emph{end statement} of the code blocks detailed in \vref{tab:code-blocks}. + All poly-switches are \emph{off} by default; \texttt{latexindent.pl} searches first of all for per-name settings, and then followed by global per-thing settings. + +\subsection{modifyLineBreaks for environments} + \label{sec:modifylinebreaks-environments} + We start by viewing a snippet of \texttt{defaultSettings.yaml} in \cref{lst:environments-mlb}; note that it contains \emph{global} settings (immediately after the \texttt{environments} field) and that \emph{per-name} settings are also allowed -- in the case of \cref{lst:environments-mlb}, settings for \texttt{equation*} have been specified. + Note that all poly-switches are \emph{off} by default. + + \cmhlistingsfromfile[style=modifylinebreaksEnv]*{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,MLB-TCB]{\texttt{environments}}{lst:environments-mlb} + + Let's begin with the simple example given in \cref{lst:env-mlb1-tex}; note that we have annotated key parts of the file using $\BeginStartsOnOwnLine$, $\BodyStartsOnOwnLine$, $\EndStartsOnOwnLine$ and $\EndFinishesWithLineBreak$, these will be related to fields specified in \cref{lst:environments-mlb}. + + \begin{cmhlistings}[style=tcblatex,escapeinside={(*@}{@*)}]{\texttt{env-mlb1.tex}}{lst:env-mlb1-tex} +before words(*@$\BeginStartsOnOwnLine$@*) \begin{myenv}(*@$\BodyStartsOnOwnLine$@*)body of myenv(*@$\EndStartsOnOwnLine$@*)\end{myenv}(*@$\EndFinishesWithLineBreak$@*) after words +\end{cmhlistings} + +\subsubsection[Adding line breaks: \texttt{BeginStartsOnOwnLine} and \texttt{BodyStartsOnOwnLine}]{Adding line breaks using \texttt{BeginStartsOnOwnLine} and \texttt{BodyStartsOnOwnLine}} + Let's explore \texttt{BeginStartsOnOwnLine} and \texttt{BodyStartsOnOwnLine} in \cref{lst:env-mlb1,lst:env-mlb2}, and in particular, let's allow each of them in turn to take a value of $1$. + + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/env-mlb1.yaml}[MLB-TCB]{\texttt{env-mlb1.yaml}}{lst:env-mlb1} + \end{minipage} + \hfill + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/env-mlb2.yaml}[MLB-TCB]{\texttt{env-mlb2.yaml}}{lst:env-mlb2} + \end{minipage} + + After running the following commands, \begin{commandshell} +latexindent.pl -m env-mlb.tex -l env-mlb1.yaml +latexindent.pl -m env-mlb.tex -l env-mlb2.yaml +\end{commandshell} the output is as in \cref{lst:env-mlb-mod1,lst:env-mlb-mod2} respectively. + + \begin{widepage} + \begin{minipage}{.56\linewidth} + \cmhlistingsfromfile{demonstrations/env-mlb-mod1.tex}{\texttt{env-mlb.tex} using \cref{lst:env-mlb1}}{lst:env-mlb-mod1} + \end{minipage} + \hfill + \begin{minipage}{.43\linewidth} + \cmhlistingsfromfile{demonstrations/env-mlb-mod2.tex}{\texttt{env-mlb.tex} using \cref{lst:env-mlb2}}{lst:env-mlb-mod2} + \end{minipage} + \end{widepage} + + There are a couple of points to note: \begin{itemize} \item in \cref{lst:env-mlb-mod1} a line break has been added at the point denoted by $\BeginStartsOnOwnLine$ in \cref{lst:env-mlb1-tex}; no other line breaks have been changed; + \item in \cref{lst:env-mlb-mod2} a line break has been added at the point denoted by $\BodyStartsOnOwnLine$ in \cref{lst:env-mlb1-tex}; furthermore, note that the \emph{body} of \texttt{myenv} has received the appropriate (default) indentation. + \end{itemize} + + Let's now change each of the \texttt{1} values in \cref{lst:env-mlb1,lst:env-mlb2} so that they are $2$ and save them into \texttt{env-mlb3.yaml} and \texttt{env-mlb4.yaml} respectively (see \cref{lst:env-mlb3,lst:env-mlb4}). + + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/env-mlb3.yaml}[MLB-TCB]{\texttt{env-mlb3.yaml}}{lst:env-mlb3} + \end{minipage} + \hfill + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/env-mlb4.yaml}[MLB-TCB]{\texttt{env-mlb4.yaml}}{lst:env-mlb4} + \end{minipage} + + Upon running commands analogous to the above, we obtain \cref{lst:env-mlb-mod3,lst:env-mlb-mod4}. + + \begin{widepage} + \begin{minipage}{.56\linewidth} + \cmhlistingsfromfile{demonstrations/env-mlb-mod3.tex}{\texttt{env-mlb.tex} using \cref{lst:env-mlb3}}{lst:env-mlb-mod3} + \end{minipage} + \hfill + \begin{minipage}{.43\linewidth} + \cmhlistingsfromfile{demonstrations/env-mlb-mod4.tex}{\texttt{env-mlb.tex} using \cref{lst:env-mlb4}}{lst:env-mlb-mod4} + \end{minipage} + \end{widepage} + + Note that line breaks have been added as in \cref{lst:env-mlb-mod1,lst:env-mlb-mod2}, but this time a comment symbol has been added before adding the line break; in both cases, trailing horizontal space has been stripped before doing so. + + Let's% + \announce{2017-08-21}{demonstration of blank line poly-switch (3)} now change each of the \texttt{1} values in \cref{lst:env-mlb1,lst:env-mlb2} so that they are $3$ and save them into \texttt{env-mlb5.yaml} and \texttt{env-mlb6.yaml} respectively (see \cref{lst:env-mlb5,lst:env-mlb6}). + % + + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/env-mlb5.yaml}[MLB-TCB]{\texttt{env-mlb5.yaml}}{lst:env-mlb5} + \end{minipage} + \hfill + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/env-mlb6.yaml}[MLB-TCB]{\texttt{env-mlb6.yaml}}{lst:env-mlb6} + \end{minipage} + + Upon running commands analogous to the above, we obtain \cref{lst:env-mlb-mod5,lst:env-mlb-mod6}. + + \begin{widepage} + \begin{minipage}{.56\linewidth} + \cmhlistingsfromfile{demonstrations/env-mlb-mod5.tex}{\texttt{env-mlb.tex} using \cref{lst:env-mlb5}}{lst:env-mlb-mod5} + \end{minipage} + \hfill + \begin{minipage}{.43\linewidth} + \cmhlistingsfromfile{demonstrations/env-mlb-mod6.tex}{\texttt{env-mlb.tex} using \cref{lst:env-mlb6}}{lst:env-mlb-mod6} + \end{minipage} + \end{widepage} + + Note that line breaks have been added as in \cref{lst:env-mlb-mod1,lst:env-mlb-mod2}, but this time a \emph{blank line} has been added after adding the line break. + +\subsubsection[Adding line breaks: \texttt{EndStartsOnOwnLine} and \texttt{EndFinishesWithLineBreak}]{Adding line breaks using \texttt{EndStartsOnOwnLine} and \texttt{EndFinishesWithLineBreak}} + Let's explore \texttt{EndStartsOnOwnLine} and \texttt{EndFinishesWithLineBreak} in \cref{lst:env-mlb7,lst:env-mlb8}, and in particular, let's allow each of them in turn to take a value of $1$. + + \begin{minipage}{.49\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/env-mlb7.yaml}[MLB-TCB]{\texttt{env-mlb7.yaml}}{lst:env-mlb7} + \end{minipage} + \hfill + \begin{minipage}{.49\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/env-mlb8.yaml}[MLB-TCB]{\texttt{env-mlb8.yaml}}{lst:env-mlb8} + \end{minipage} + + After running the following commands, \begin{commandshell} +latexindent.pl -m env-mlb.tex -l env-mlb7.yaml +latexindent.pl -m env-mlb.tex -l env-mlb8.yaml +\end{commandshell} the output is as in \cref{lst:env-mlb-mod7,lst:env-mlb-mod8}. + + \begin{widepage} + \begin{minipage}{.42\linewidth} + \cmhlistingsfromfile{demonstrations/env-mlb-mod7.tex}{\texttt{env-mlb.tex} using \cref{lst:env-mlb7}}{lst:env-mlb-mod7} + \end{minipage} + \hfill + \begin{minipage}{.57\linewidth} + \cmhlistingsfromfile{demonstrations/env-mlb-mod8.tex}{\texttt{env-mlb.tex} using \cref{lst:env-mlb8}}{lst:env-mlb-mod8} + \end{minipage} + \end{widepage} + + There are a couple of points to note: \begin{itemize} \item in \cref{lst:env-mlb-mod7} a line break has been added at the point denoted by $\EndStartsOnOwnLine$ in \vref{lst:env-mlb1-tex}; no other line breaks have been changed and the \lstinline!\end{myenv}! statement has \emph{not} received indentation (as intended); + \item in \cref{lst:env-mlb-mod8} a line break has been added at the point denoted by $\EndFinishesWithLineBreak$ in \vref{lst:env-mlb1-tex}. + \end{itemize} + + Let's now change each of the \texttt{1} values in \cref{lst:env-mlb7,lst:env-mlb8} so that they are $2$ and save them into \texttt{env-mlb9.yaml} and \texttt{env-mlb10.yaml} respectively (see \cref{lst:env-mlb9,lst:env-mlb10}). + + \begin{minipage}{.49\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/env-mlb9.yaml}[MLB-TCB]{\texttt{env-mlb9.yaml}}{lst:env-mlb9} + \end{minipage} + \hfill + \begin{minipage}{.49\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/env-mlb10.yaml}[MLB-TCB]{\texttt{env-mlb10.yaml}}{lst:env-mlb10} + \end{minipage} + + Upon running commands analogous to the above, we obtain \cref{lst:env-mlb-mod9,lst:env-mlb-mod10}. + + \begin{widepage} + \begin{minipage}{.43\linewidth} + \cmhlistingsfromfile{demonstrations/env-mlb-mod9.tex}{\texttt{env-mlb.tex} using \cref{lst:env-mlb9}}{lst:env-mlb-mod9} + \end{minipage} + \hfill + \begin{minipage}{.56\linewidth} + \cmhlistingsfromfile{demonstrations/env-mlb-mod10.tex}{\texttt{env-mlb.tex} using \cref{lst:env-mlb10}}{lst:env-mlb-mod10} + \end{minipage} + \end{widepage} + + Note that line breaks have been added as in \cref{lst:env-mlb-mod7,lst:env-mlb-mod8}, but this time a comment symbol has been added before adding the line break; in both cases, trailing horizontal space has been stripped before doing so. + + Let's% + \announce{2017-08-21}{demonstration of blank line poly-switch (3)} now change each of the \texttt{1} values in \cref{lst:env-mlb7,lst:env-mlb8} so that they are $3$ and save them into \texttt{env-mlb11.yaml} and \texttt{env-mlb12.yaml} respectively (see \cref{lst:env-mlb11,lst:env-mlb12}). + % + + \begin{minipage}{.49\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/env-mlb11.yaml}[MLB-TCB]{\texttt{env-mlb11.yaml}}{lst:env-mlb11} + \end{minipage} + \hfill + \begin{minipage}{.49\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/env-mlb12.yaml}[MLB-TCB]{\texttt{env-mlb12.yaml}}{lst:env-mlb12} + \end{minipage} + + Upon running commands analogous to the above, we obtain \cref{lst:env-mlb-mod11,lst:env-mlb-mod12}. + + \begin{widepage} + \begin{minipage}{.42\linewidth} + \cmhlistingsfromfile{demonstrations/env-mlb-mod11.tex}{\texttt{env-mlb.tex} using \cref{lst:env-mlb11}}{lst:env-mlb-mod11} + \end{minipage} + \hfill + \begin{minipage}{.57\linewidth} + \cmhlistingsfromfile{demonstrations/env-mlb-mod12.tex}{\texttt{env-mlb.tex} using \cref{lst:env-mlb12}}{lst:env-mlb-mod12} + \end{minipage} + \end{widepage} + + Note that line breaks have been added as in \cref{lst:env-mlb-mod7,lst:env-mlb-mod8}, and that a \emph{blank line} has been added after the line break. + +\subsubsection{poly-switches only add line breaks when necessary} + If you ask \texttt{latexindent.pl} to add a line break (possibly with a comment) using a poly-switch value of $1$ (or $2$), it will only do so if necessary. + For example, if you process the file in \vref{lst:mlb2} using any of the YAML files presented so far in this section, it will be left unchanged. + + \begin{minipage}{.45\linewidth} + \cmhlistingsfromfile{demonstrations/env-mlb2.tex}{\texttt{env-mlb2.tex}}{lst:mlb2} + \end{minipage} + \hfill + \begin{minipage}{.45\linewidth} + \cmhlistingsfromfile{demonstrations/env-mlb3.tex}{\texttt{env-mlb3.tex}}{lst:mlb3} + \end{minipage} + + In contrast, the output from processing the file in \cref{lst:mlb3} will vary depending on the poly-switches used; in \cref{lst:env-mlb3-mod2} you'll see that the comment symbol after the \lstinline!\begin{myenv}! has been moved to the next line, as \texttt{BodyStartsOnOwnLine} is set to \texttt{1}. + In \cref{lst:env-mlb3-mod4} you'll see that the comment has been accounted for correctly because \texttt{BodyStartsOnOwnLine} has been set to \texttt{2}, and the comment symbol has \emph{not} been moved to its own line. + You're encouraged to experiment with \cref{lst:mlb3} and by setting the other poly-switches considered so far to \texttt{2} in turn. + + \begin{minipage}{.45\linewidth} + \cmhlistingsfromfile{demonstrations/env-mlb3-mod2.tex}{\texttt{env-mlb3.tex} using \vref{lst:env-mlb2}}{lst:env-mlb3-mod2} + \end{minipage} + \hfill + \begin{minipage}{.45\linewidth} + \cmhlistingsfromfile{demonstrations/env-mlb3-mod4.tex}{\texttt{env-mlb3.tex} using \vref{lst:env-mlb4}}{lst:env-mlb3-mod4} + \end{minipage} + + The details of the discussion in this section have concerned \emph{global} poly-switches in the \texttt{environments} field; each switch can also be specified on a \emph{per-name} basis, which would take priority over the global values; with reference to \vref{lst:environments-mlb}, an example is shown for the \texttt{equation*} environment. + +\subsubsection{Removing line breaks (poly-switches set to $-1$)} + Setting poly-switches to $-1$ tells \texttt{latexindent.pl} to remove line breaks of the \emph{<part of the thing>}, if necessary. + We will consider the example code given in \cref{lst:mlb4}, noting in particular the positions of the line break highlighters, $\BeginStartsOnOwnLine$, $\BodyStartsOnOwnLine$, $\EndStartsOnOwnLine$ and $\EndFinishesWithLineBreak$, together with the associated YAML files in \crefrange{lst:env-mlb13}{lst:env-mlb16}. + + \begin{minipage}{.45\linewidth} + \begin{cmhlistings}[style=tcblatex,escapeinside={(*@}{@*)}]{\texttt{env-mlb4.tex}}{lst:mlb4} +before words(*@$\BeginStartsOnOwnLine$@*) +\begin{myenv}(*@$\BodyStartsOnOwnLine$@*) +body of myenv(*@$\EndStartsOnOwnLine$@*) +\end{myenv}(*@$\EndFinishesWithLineBreak$@*) +after words +\end{cmhlistings} + \end{minipage}% + \hfill + \begin{minipage}{.51\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/env-mlb13.yaml}[MLB-TCB]{\texttt{env-mlb13.yaml}}{lst:env-mlb13} + + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/env-mlb14.yaml}[MLB-TCB]{\texttt{env-mlb14.yaml}}{lst:env-mlb14} + + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/env-mlb15.yaml}[MLB-TCB]{\texttt{env-mlb15.yaml}}{lst:env-mlb15} + + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/env-mlb16.yaml}[MLB-TCB]{\texttt{env-mlb16.yaml}}{lst:env-mlb16} + \end{minipage} + + After running the commands \begin{commandshell} +latexindent.pl -m env-mlb4.tex -l env-mlb13.yaml +latexindent.pl -m env-mlb4.tex -l env-mlb14.yaml +latexindent.pl -m env-mlb4.tex -l env-mlb15.yaml +latexindent.pl -m env-mlb4.tex -l env-mlb16.yaml +\end{commandshell} + + we obtain the respective output in \crefrange{lst:env-mlb4-mod13}{lst:env-mlb4-mod16}. + + \begin{minipage}{.45\linewidth} + \cmhlistingsfromfile{demonstrations/env-mlb4-mod13.tex}{\texttt{env-mlb4.tex} using \cref{lst:env-mlb13}}{lst:env-mlb4-mod13} + \end{minipage} + \hfill + \begin{minipage}{.45\linewidth} + \cmhlistingsfromfile{demonstrations/env-mlb4-mod14.tex}{\texttt{env-mlb4.tex} using \cref{lst:env-mlb14}}{lst:env-mlb4-mod14} + \end{minipage} + + \begin{minipage}{.45\linewidth} + \cmhlistingsfromfile{demonstrations/env-mlb4-mod15.tex}{\texttt{env-mlb4.tex} using \cref{lst:env-mlb15}}{lst:env-mlb4-mod15} + \end{minipage} + \hfill + \begin{minipage}{.45\linewidth} + \cmhlistingsfromfile{demonstrations/env-mlb4-mod16.tex}{\texttt{env-mlb4.tex} using \cref{lst:env-mlb16}}{lst:env-mlb4-mod16} + \end{minipage} + + Notice that in: \begin{itemize} \item \cref{lst:env-mlb4-mod13} the line break denoted by $\BeginStartsOnOwnLine$ in \cref{lst:mlb4} has been removed; + \item \cref{lst:env-mlb4-mod14} the line break denoted by $\BodyStartsOnOwnLine$ in \cref{lst:mlb4} has been removed; + \item \cref{lst:env-mlb4-mod15} the line break denoted by $\EndStartsOnOwnLine$ in \cref{lst:mlb4} has been removed; + \item \cref{lst:env-mlb4-mod16} the line break denoted by $\EndFinishesWithLineBreak$ in \cref{lst:mlb4} has been removed. + \end{itemize} + We examined each of these cases separately for clarity of explanation, but you can combine all of the YAML settings in \crefrange{lst:env-mlb13}{lst:env-mlb16} into one file; alternatively, you could tell \texttt{latexindent.pl} to load them all by using the following command, for example \begin{widepage} \begin{commandshell} +latexindent.pl -m env-mlb4.tex -l env-mlb13.yaml,env-mlb14.yaml,env-mlb15.yaml,env-mlb16.yaml +\end{commandshell} \end{widepage} which gives the output in \vref{lst:env-mlb1-tex}. + +\subsubsection{About trailing horizontal space} + Recall that on \cpageref{yaml:removeTrailingWhitespace} we discussed the YAML field \texttt{removeTrailingWhitespace}, and that it has two (binary) switches to determine if horizontal space should be removed \texttt{beforeProcessing} and \texttt{afterProcessing}. + The \texttt{beforeProcessing} is particularly relevant when considering the \texttt{-m} switch; let's consider the file shown in \cref{lst:mlb5}, which highlights trailing spaces. + + \begin{minipage}{.45\linewidth} + \begin{cmhlistings}[style=tcblatex,showspaces=true,escapeinside={(*@}{@*)}]{\texttt{env-mlb5.tex}}{lst:mlb5} +before words (*@$\BeginStartsOnOwnLine$@*) +\begin{myenv} (*@$\BodyStartsOnOwnLine$@*) +body of myenv (*@$\EndStartsOnOwnLine$@*) +\end{myenv} (*@$\EndFinishesWithLineBreak$@*) +after words +\end{cmhlistings} + \end{minipage} + \hfill + \begin{minipage}{.45\linewidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/removeTWS-before.yaml}[yaml-TCB]{\texttt{removeTWS-before.yaml}}{lst:removeTWS-before} + \end{minipage} + + The output from the following commands \begin{widepage} \begin{commandshell} +latexindent.pl -m env-mlb5.tex -l env-mlb13.yaml,env-mlb14.yaml,env-mlb15.yaml,env-mlb16.yaml +latexindent.pl -m env-mlb5.tex -l env-mlb13.yaml,env-mlb14.yaml,env-mlb15.yaml,env-mlb16.yaml,removeTWS-before.yaml +\end{commandshell} \end{widepage} is shown, respectively, in \cref{lst:env-mlb5-modAll,lst:env-mlb5-modAll-remove-WS}; note that the trailing horizontal white space has been preserved (by default) in \cref{lst:env-mlb5-modAll}, while in \cref{lst:env-mlb5-modAll-remove-WS}, it has been removed using the switch specified in \cref{lst:removeTWS-before}. + + \begin{widepage} + \cmhlistingsfromfile[showspaces=true]{demonstrations/env-mlb5-modAll.tex}{\texttt{env-mlb5.tex} using \crefrange{lst:env-mlb4-mod13}{lst:env-mlb4-mod16}}{lst:env-mlb5-modAll} + + \cmhlistingsfromfile[showspaces=true]{demonstrations/env-mlb5-modAll-remove-WS.tex}{\texttt{env-mlb5.tex} using \crefrange{lst:env-mlb4-mod13}{lst:env-mlb4-mod16} \emph{and} \cref{lst:removeTWS-before}}{lst:env-mlb5-modAll-remove-WS} + \end{widepage} + +\subsubsection{poly-switch line break removal and blank lines} + Now let's consider the file in \cref{lst:mlb6}, which contains blank lines. + + \begin{minipage}{.45\linewidth} + \begin{cmhlistings}[style=tcblatex,escapeinside={(*@}{@*)}]{\texttt{env-mlb6.tex}}{lst:mlb6} +before words(*@$\BeginStartsOnOwnLine$@*) + + +\begin{myenv}(*@$\BodyStartsOnOwnLine$@*) + + +body of myenv(*@$\EndStartsOnOwnLine$@*) + + +\end{myenv}(*@$\EndFinishesWithLineBreak$@*) + +after words +\end{cmhlistings} + \end{minipage}% + \hfill + \begin{minipage}{.45\linewidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/UnpreserveBlankLines.yaml}[MLB-TCB]{\texttt{UnpreserveBlankLines.yaml}}{lst:UnpreserveBlankLines} + \end{minipage} + + Upon running the following commands \begin{widepage} \begin{commandshell} +latexindent.pl -m env-mlb6.tex -l env-mlb13.yaml,env-mlb14.yaml,env-mlb15.yaml,env-mlb16.yaml +latexindent.pl -m env-mlb6.tex -l env-mlb13.yaml,env-mlb14.yaml,env-mlb15.yaml,env-mlb16.yaml,UnpreserveBlankLines.yaml +\end{commandshell} \end{widepage} we receive the respective outputs in \cref{lst:env-mlb6-modAll,lst:env-mlb6-modAll-un-Preserve-Blank-Lines}. + In \cref{lst:env-mlb6-modAll} we see that the multiple blank lines have each been condensed into one blank line, but that blank lines have \emph{not} been removed by the poly-switches -- this is because, by default, \texttt{preserveBlankLines} is set to \texttt{1}. + By contrast, in \cref{lst:env-mlb6-modAll-un-Preserve-Blank-Lines}, we have allowed the poly-switches to remove blank lines because, in \cref{lst:UnpreserveBlankLines}, we have set \texttt{preserveBlankLines} to \texttt{0}. + + \begin{widepage} + \begin{minipage}{.30\linewidth} + \cmhlistingsfromfile{demonstrations/env-mlb6-modAll.tex}{\texttt{env-mlb6.tex} using \crefrange{lst:env-mlb4-mod13}{lst:env-mlb4-mod16}}{lst:env-mlb6-modAll} + \end{minipage} + \hfill + \begin{minipage}{.65\linewidth} + \cmhlistingsfromfile{demonstrations/env-mlb6-modAll-un-Preserve-Blank-Lines.tex}{\texttt{env-mlb6.tex} using \crefrange{lst:env-mlb4-mod13}{lst:env-mlb4-mod16} \emph{and} \cref{lst:UnpreserveBlankLines}}{lst:env-mlb6-modAll-un-Preserve-Blank-Lines} + \end{minipage} + \end{widepage} + + We can explore this further using the blank-line poly-switch value of $3$; let's use the file given in \cref{lst:env-mlb7-tex}. + + \cmhlistingsfromfile{demonstrations/env-mlb7.tex}{\texttt{env-mlb7.tex}}{lst:env-mlb7-tex} + + Upon running the following commands \begin{commandshell} +latexindent.pl -m env-mlb7.tex -l env-mlb12.yaml,env-mlb13.yaml +latexindent.pl -m env-mlb7.tex -l env-mlb13.yaml,env-mlb14.yaml,UnpreserveBlankLines.yaml + \end{commandshell} we receive the outputs given in \cref{lst:env-mlb7-preserve,lst:env-mlb7-no-preserve}. + + \cmhlistingsfromfile{demonstrations/env-mlb7-preserve.tex}{\texttt{env-mlb7-preserve.tex}}{lst:env-mlb7-preserve} + \cmhlistingsfromfile{demonstrations/env-mlb7-no-preserve.tex}{\texttt{env-mlb7-no-preserve.tex}}{lst:env-mlb7-no-preserve} + + Notice that in: \begin{itemize} \item \cref{lst:env-mlb7-preserve} that \lstinline!\end{one}! has added a blank line, because of the value of \texttt{EndFinishesWithLineBreak} in \vref{lst:env-mlb12}, and even though the line break ahead of \lstinline!\begin{two}! should have been removed (because of \texttt{BeginStartsOnOwnLine} in \vref{lst:env-mlb13}), the blank line has been preserved by default; + \item \cref{lst:env-mlb7-no-preserve}, by contrast, has had the additional line-break removed, because of the settings in \cref{lst:UnpreserveBlankLines}. + \end{itemize} + +\subsection{Poly-switches for other code blocks} + Rather than repeat the examples shown for the environment code blocks (in \vref{sec:modifylinebreaks-environments}), we choose to detail the poly-switches for all other code blocks in \cref{tab:poly-switch-mapping}; note that each and every one of these poly-switches is \emph{off by default}, i.e, set to \texttt{0}. + Note also that, by design, line breaks involving \texttt{verbatim}, \texttt{filecontents} and `comment-marked' code blocks (\vref{lst:alignmentmarkup}) can \emph{not} be modified using \texttt{latexindent.pl}. + + \begin{longtable}{m{.2\textwidth}@{\hspace{.75cm}}m{.35\textwidth}@{}m{.4\textwidth}} + \caption{Poly-switch mappings for all code-block types}\label{tab:poly-switch-mapping} \\ + \toprule + Code block & Sample & Poly-switch mapping \\ + \midrule + environment & + \begin{lstlisting}[style=tcblatex,escapeinside={(*@}{@*)},nolol=true] +before words(*@$\BeginStartsOnOwnLine$@*) +\begin{myenv}(*@$\BodyStartsOnOwnLine$@*) +body of myenv(*@$\EndStartsOnOwnLine$@*) +\end{myenv}(*@$\EndFinishesWithLineBreak$@*) +after words + \end{lstlisting} + & + \begin{tabular}[t]{c@{~}l@{}} + $\BeginStartsOnOwnLine$ & BeginStartsOnOwnLine \\ + $\BodyStartsOnOwnLine$ & BodyStartsOnOwnLine \\ + $\EndStartsOnOwnLine$ & EndStartsOnOwnLine \\ + $\EndFinishesWithLineBreak$ & EndFinishesWithLineBreak \\ + \end{tabular} + \\ + \cmidrule{2-3} + ifelsefi & + \begin{lstlisting}[style=tcblatex,escapeinside={(*@}{@*)},nolol=true] +before words(*@$\BeginStartsOnOwnLine$@*) +\if...(*@$\BodyStartsOnOwnLine$@*) +body of if statement(*@$\ElseStartsOnOwnLine$@*) +\else(*@$\ElseFinishesWithLineBreak$@*) +body of else statement(*@$\EndStartsOnOwnLine$@*) +\fi(*@$\EndFinishesWithLineBreak$@*) +after words + \end{lstlisting} + & + \begin{tabular}[t]{c@{~}l@{}} + $\BeginStartsOnOwnLine$ & IfStartsOnOwnLine \\ + $\BodyStartsOnOwnLine$ & BodyStartsOnOwnLine \\ + $\ElseStartsOnOwnLine$ & ElseStartsOnOwnLine \\ + $\ElseFinishesWithLineBreak$ & ElseFinishesWithLineBreak \\ + $\EndStartsOnOwnLine$ & FiStartsOnOwnLine \\ + $\EndFinishesWithLineBreak$ & FiFinishesWithLineBreak \\ + \end{tabular} + \\ + \cmidrule{2-3} + optionalArguments & + \begin{lstlisting}[style=tcblatex,escapeinside={(*@}{@*)},nolol=true] +...(*@$\BeginStartsOnOwnLine$@*) +[(*@$\BodyStartsOnOwnLine$@*) +body of opt arg(*@$\EndStartsOnOwnLine$@*) +](*@$\EndFinishesWithLineBreak$@*) +... + \end{lstlisting} + & + \begin{tabular}[t]{c@{~}l@{}} + $\BeginStartsOnOwnLine$ & LSqBStartsOnOwnLine\footnote{LSqB stands for Left Square Bracket} \\ + $\BodyStartsOnOwnLine$ & OptArgBodyStartsOnOwnLine \\ + $\EndStartsOnOwnLine$ & RSqBStartsOnOwnLine \\ + $\EndFinishesWithLineBreak$ & RSqBFinishesWithLineBreak \\ + \end{tabular} + \\ + \cmidrule{2-3} + mandatoryArguments & + \begin{lstlisting}[style=tcblatex,escapeinside={(*@}{@*)},nolol=true] +...(*@$\BeginStartsOnOwnLine$@*) +{(*@$\BodyStartsOnOwnLine$@*) +body of mand arg(*@$\EndStartsOnOwnLine$@*) +}(*@$\EndFinishesWithLineBreak$@*) +... + \end{lstlisting} + & + \begin{tabular}[t]{c@{~}l@{}} + $\BeginStartsOnOwnLine$ & LCuBStartsOnOwnLine\footnote{LCuB stands for Left Curly Brace} \\ + $\BodyStartsOnOwnLine$ & MandArgBodyStartsOnOwnLine \\ + $\EndStartsOnOwnLine$ & RCuBStartsOnOwnLine \\ + $\EndFinishesWithLineBreak$ & RCuBFinishesWithLineBreak \\ + \end{tabular} + \\ + \cmidrule{2-3} + commands & + \begin{lstlisting}[style=tcblatex,escapeinside={(*@}{@*)},morekeywords={mycommand},nolol=true,] +before words(*@$\BeginStartsOnOwnLine$@*) +\mycommand(*@$\BodyStartsOnOwnLine$@*) +(*@$\langle$\itshape{arguments}$\rangle$@*) + \end{lstlisting} + & + \begin{tabular}[t]{c@{~}l@{}} + $\BeginStartsOnOwnLine$ & CommandStartsOnOwnLine \\ + $\BodyStartsOnOwnLine$ & CommandNameFinishesWithLineBreak \\ + \end{tabular} + \\ + \cmidrule{2-3} + namedGroupingBraces Brackets & + \begin{lstlisting}[style=tcblatex,escapeinside={(*@}{@*)},morekeywords={myname},nolol=true,] +before words(*@$\BeginStartsOnOwnLine$@*) +myname(*@$\BodyStartsOnOwnLine$@*) +(*@$\langle$\itshape{braces/brackets}$\rangle$@*) + \end{lstlisting} + & + \begin{tabular}[t]{c@{~}l@{}} + $\BeginStartsOnOwnLine$ & NameStartsOnOwnLine \\ + $\BodyStartsOnOwnLine$ & NameFinishesWithLineBreak \\ + \end{tabular} + \\ + \cmidrule{2-3} + keyEqualsValuesBraces\newline Brackets & + \begin{lstlisting}[style=tcblatex,escapeinside={(*@}{@*)},morekeywords={key},nolol=true,] +before words(*@$\BeginStartsOnOwnLine$@*) +key(*@$\EqualsStartsOnOwnLine$@*)=(*@$\BodyStartsOnOwnLine$@*) +(*@$\langle$\itshape{braces/brackets}$\rangle$@*) + \end{lstlisting} + & + \begin{tabular}[t]{c@{~}l@{}} + $\BeginStartsOnOwnLine$ & KeyStartsOnOwnLine \\ + $\EqualsStartsOnOwnLine$ & EqualsStartsOnOwnLine \\ + $\BodyStartsOnOwnLine$ & EqualsFinishesWithLineBreak \\ + \end{tabular} + \\ + \cmidrule{2-3} + items & + \begin{lstlisting}[style=tcblatex,escapeinside={(*@}{@*)},nolol=true] +before words(*@$\BeginStartsOnOwnLine$@*) +\item(*@$\BodyStartsOnOwnLine$@*) +... + \end{lstlisting} + & + \begin{tabular}[t]{c@{~}l@{}} + $\BeginStartsOnOwnLine$ & ItemStartsOnOwnLine \\ + $\BodyStartsOnOwnLine$ & ItemFinishesWithLineBreak \\ + \end{tabular} + \\ + \cmidrule{2-3} + specialBeginEnd & + \begin{lstlisting}[style=tcblatex,escapeinside={(*@}{@*)},nolol=true] +before words(*@$\BeginStartsOnOwnLine$@*) +\[(*@$\BodyStartsOnOwnLine$@*) +body of special(*@$\EndStartsOnOwnLine$@*) +\](*@$\EndFinishesWithLineBreak$@*) +after words + \end{lstlisting} + & + \begin{tabular}[t]{c@{~}l@{}} + $\BeginStartsOnOwnLine$ & SpecialBeginStartsOnOwnLine \\ + $\BodyStartsOnOwnLine$ & SpecialBodyStartsOnOwnLine \\ + $\EndStartsOnOwnLine$ & SpecialEndStartsOnOwnLine \\ + $\EndFinishesWithLineBreak$ & SpecialEndFinishesWithLineBreak \\ + \end{tabular} + \\ + \bottomrule + \end{longtable} diff --git a/test-cases/documentation/subsec-commands-and-their-options-mod1.tex b/test-cases/documentation/subsec-commands-and-their-options-mod1.tex new file mode 100644 index 00000000..9746ed71 --- /dev/null +++ b/test-cases/documentation/subsec-commands-and-their-options-mod1.tex @@ -0,0 +1,139 @@ +% arara: pdflatex: {shell: yes, files: [latexindent]} +\subsection{Commands and the strings between their arguments} + \label{subsec:commands-string-between} + The \texttt{command} code blocks will always look for optional (square bracketed) and mandatory (curly braced) arguments which can contain comments, line breaks and `beamer' commands \lstinline!<.*?>! between them. + There are switches that can allow them to contain other strings, which we discuss next. + +\yamltitle{commandCodeBlocks}*{fields} + + The \texttt{commandCodeBlocks} field% + \announce{2017-08-21}*{commandCodeBlocks} contains a few switches detailed in \cref{lst:commandCodeBlocks}. + % + + \cmhlistingsfromfile[style=commandCodeBlocks]*{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{commandCodeBlocks}}{lst:commandCodeBlocks} + +\yamltitle{roundParenthesesAllowed}{0|1} + + The need for this field was mostly motivated by commands found in code used to generate images in \texttt{PSTricks} and \texttt{tikz}; for example, let's consider the code given in \cref{lst:pstricks1}. + + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile{demonstrations/pstricks1.tex}{\texttt{pstricks1.tex}}{lst:pstricks1} + \end{minipage} + \hfill + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile{demonstrations/pstricks1-default.tex}{\texttt{pstricks1} default output}{lst:pstricks1-default} + \end{minipage} + + Notice that the \lstinline!\defFunction! command has an optional argument, followed by a mandatory argument, followed by a round-parenthesis argument, $(u,v)$. + + By default, because \texttt{roundParenthesesAllowed} is set to $1$ in \cref{lst:commandCodeBlocks}, then \texttt{latexindent.pl} will allow round parenthesis between optional and mandatory arguments. + In the case of the code in \cref{lst:pstricks1}, \texttt{latexindent.pl} finds \emph{all} the arguments of \lstinline!defFunction!, both before and after \lstinline!(u,v)!. + + The default output from running \texttt{latexindent.pl} on \cref{lst:pstricks1} actually leaves it unchanged (see \cref{lst:pstricks1-default}); note in particular, this is because of \texttt{noAdditionalIndentGlobal} as discussed on \cpageref{page:command:noAddGlobal}. + + Upon using the YAML settings in \cref{lst:noRoundParentheses}, and running the command \begin{commandshell} +latexindent.pl pstricks1.tex -l noRoundParentheses.yaml + \end{commandshell} we obtain the output given in \cref{lst:pstricks1-nrp}. + + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile{demonstrations/pstricks1-nrp.tex}{\texttt{pstricks1.tex} using \cref{lst:noRoundParentheses}}{lst:pstricks1-nrp} + \end{minipage} + \hfill + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/noRoundParentheses.yaml}[yaml-TCB]{\texttt{noRoundParentheses.yaml}}{lst:noRoundParentheses} + \end{minipage} + + Notice the difference between \cref{lst:pstricks1-default} and \cref{lst:pstricks1-nrp}; in particular, in \cref{lst:pstricks1-nrp}, because round parentheses are \emph{not} allowed, \texttt{latexindent.pl} finds that the \lstinline!\defFunction! command finishes at the first opening round parenthesis. + As such, the remaining braced, mandatory, arguments are found to be \texttt{UnNamedGroupingBracesBrackets} (see \vref{tab:code-blocks}) which, by default, assume indentation for their body, and hence the tabbed indentation in \cref{lst:pstricks1-nrp}. + + Let's explore this using the YAML given in \cref{lst:defFunction} and run the command \begin{commandshell} +latexindent.pl pstricks1.tex -l defFunction.yaml + \end{commandshell} then the output is as in \cref{lst:pstricks1-indent-rules}. + + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile[showspaces=true]{demonstrations/pstricks1-indent-rules.tex}{\texttt{pstricks1.tex} using \cref{lst:defFunction}}{lst:pstricks1-indent-rules} + \end{minipage} + \hfill + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/defFunction.yaml}[yaml-TCB]{\texttt{defFunction.yaml}}{lst:defFunction} + \end{minipage} + + Notice in \cref{lst:pstricks1-indent-rules} that the \emph{body} of the \lstinline!defFunction! command i.e, the subsequent lines containing arguments after the command name, have received the single space of indentation specified by \cref{lst:defFunction}. + +\yamltitle{stringsAllowedBetweenArguments}*{fields} + \texttt{tikz} users may well specify code such as that given in \cref{lst:tikz-node1}; processing this code using \texttt{latexindent.pl} gives the default output in \cref{lst:tikz-node1-default}. + + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile[columns=fixed]*{demonstrations/tikz-node1.tex}{\texttt{tikz-node1.tex}}{lst:tikz-node1} + \end{minipage} + \hfill + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile[columns=fixed]*{demonstrations/tikz-node1-default.tex}{\texttt{tikz-node1} default output}{lst:tikz-node1-default} + \end{minipage} + + With reference to \vref{lst:commandCodeBlocks}, we see that the strings \begin{quote} to, node, ++ \end{quote} are all allowed to appear between arguments, as they are each set to $1$; importantly, you are encouraged to add further names to this field as necessary. + This means that when \texttt{latexindent.pl} processes \cref{lst:tikz-node1}, it consumes: \begin{itemize} \item the optional argument \lstinline![thin]! + \item the round-bracketed argument \lstinline!(c)! because \texttt{roundParenthesesAllowed} is $1$ by default + \item the string \lstinline!to! (specified in \texttt{stringsAllowedBetweenArguments}) + \item the optional argument \lstinline![in=110,out=-90]! + \item the string \lstinline!++! (specified in \texttt{stringsAllowedBetweenArguments}) + \item the round-bracketed argument \lstinline!(0,-0.5cm)! because \texttt{roundParenthesesAllowed} is $1$ by default + \item the string \lstinline!node! (specified in \texttt{stringsAllowedBetweenArguments}) + \item the optional argument \lstinline![below,align=left,scale=0.5]! \end{itemize} + + We can explore this further, for example using \cref{lst:draw} and running the command \begin{commandshell} +latexindent.pl tikz-node1.tex -l draw.yaml +\end{commandshell} we receive the output given in \cref{lst:tikz-node1-draw}. + + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile[showspaces=true]{demonstrations/tikz-node1-draw.tex}{\texttt{tikz-node1.tex} using \cref{lst:draw}}{lst:tikz-node1-draw} + \end{minipage} + \hfill + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/draw.yaml}[yaml-TCB]{\texttt{draw.yaml}}{lst:draw} + \end{minipage} + + Notice that each line after the \lstinline!\draw! command (its `body') in \cref{lst:tikz-node1-draw} has been given the appropriate two-spaces worth of indentation specified in \cref{lst:draw}. + + Let's compare this with the output from using the YAML settings in \cref{lst:no-to}, and running the command \begin{commandshell} +latexindent.pl tikz-node1.tex -l no-to.yaml +\end{commandshell} given in \cref{lst:tikz-node1-no-to}. + + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile{demonstrations/tikz-node1-no-to.tex}{\texttt{tikz-node1.tex} using \cref{lst:no-to}}{lst:tikz-node1-no-to} + \end{minipage} + \hfill + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/no-to.yaml}[yaml-TCB]{\texttt{no-to.yaml}}{lst:no-to} + \end{minipage} + + In this case, \texttt{latexindent.pl} sees that: \begin{itemize} \item the \lstinline!\draw! command finishes after the \lstinline!(c)! as (\texttt{stringsAllowedBetweenArguments} has \texttt{to} set to $0$) + \item it finds a \texttt{namedGroupingBracesBrackets} called \texttt{to} (see \vref{tab:code-blocks}) \emph{with} argument \lstinline![in=110,out=-90]! + \item it finds another \texttt{namedGroupingBracesBrackets} but this time called \texttt{node} with argument \lstinline![below,align=left,scale=0.5]! \end{itemize} + +\yamltitle{commandNameSpecial}*{fields} There are some special command names% + \announce{2017-08-21}{commandNameSpecial} that do not fit within the names recognized by \texttt{latexindent.pl}, the first one of which is \lstinline!\@ifnextchar[!. + % + From the perspective of \texttt{latexindent.pl}, the whole of the text \lstinline!\@ifnextchar[! is is a command, because it is immediately followed by sets of mandatory arguments. + However, without the \texttt{commandNameSpecial} field, \texttt{latexindent.pl} would not be able to label it as such, because the \lstinline![! is, necessarily, not matched by a closing \lstinline!]!. + + For example, consider the sample file in \cref{lst:ifnextchar}, which has default output in \cref{lst:ifnextchar-default}. + + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile{demonstrations/ifnextchar.tex}{\texttt{ifnextchar.tex}}{lst:ifnextchar} + \end{minipage} + \hfill + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile{demonstrations/ifnextchar-default.tex}{\texttt{ifnextchar.tex} default output}{lst:ifnextchar-default} + \end{minipage} + + Notice that in \cref{lst:ifnextchar-default} the \texttt{parbox} command has been able to indent its body, because \texttt{latexindent.pl} has successfully found the command \lstinline!\@ifnextchar! first; the pattern-matching of \texttt{latexindent.pl} starts from \emph{the inner most <thing> and works outwards}, discussed in more detail on \cpageref{page:phases}. + For demonstration, we can compare this output with that given in \cref{lst:ifnextchar-off} in which the settings from \cref{lst:no-ifnextchar} have dictated that \lstinline!\@ifnextchar[! command should not be searched for specially; as such, the \texttt{parbox} command has been \emph{unable} to indent its body successfully, because the \lstinline!\@ifnextchar[! command has not been found. + + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile{demonstrations/ifnextchar-off.tex}{\texttt{ifnextchar.tex} using \cref{lst:no-ifnextchar}}{lst:ifnextchar-off} + \end{minipage} + \hfill + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/no-ifnextchar.yaml}[yaml-TCB]{\texttt{no-ifnextchar.yaml}}{lst:no-ifnextchar} + \end{minipage} diff --git a/test-cases/documentation/subsec-conflicting-poly-switches-mod1.tex b/test-cases/documentation/subsec-conflicting-poly-switches-mod1.tex new file mode 100644 index 00000000..efb71d5f --- /dev/null +++ b/test-cases/documentation/subsec-conflicting-poly-switches-mod1.tex @@ -0,0 +1,109 @@ +% arara: pdflatex: {shell: yes, files: [latexindent]} +\subsection{Conflicting poly-switches: sequential code blocks} + It is very easy to have conflicting poly-switches; if we use the example from \vref{lst:mycommand1}, and consider the YAML settings given in \cref{lst:mycom-mlb4}. + The output from running \begin{commandshell} +latexindent.pl -m -l=mycom-mlb4.yaml mycommand1.tex +\end{commandshell} is given in \cref{lst:mycom-mlb4}. + + \begin{minipage}{.4\linewidth} + \cmhlistingsfromfile{demonstrations/mycommand1-mlb4.tex}{\texttt{mycommand1.tex} using \cref{lst:mycom-mlb4}}{lst:mycommand1-mlb4} + \end{minipage} + \hfill + \begin{minipage}{.55\linewidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/mycom-mlb4.yaml}[MLB-TCB,width=\linewidth]{\texttt{mycom-mlb4.yaml}}{lst:mycom-mlb4} + \end{minipage} + + Studying \cref{lst:mycom-mlb4}, we see that the two poly-switches are at opposition with one another: \begin{itemize} \item on the one hand, \texttt{LCuBStartsOnOwnLine} should \emph{not} start on its own line (as poly-switch is set to $-1$); + \item on the other hand, \texttt{RCuBFinishesWithLineBreak} \emph{should} finish with a line break. + \end{itemize} + So, which should win the conflict? + As demonstrated in \cref{lst:mycommand1-mlb4}, it is clear that \texttt{LCuBStartsOnOwnLine} won this conflict, and the reason is that \emph{the second argument was processed after the first} -- in general, the most recently-processed code block and associated poly-switch takes priority. + + We can explore this further by considering the YAML settings in \cref{lst:mycom-mlb5}; upon running the command \begin{commandshell} +latexindent.pl -m -l=mycom-mlb5.yaml mycommand1.tex +\end{commandshell} we obtain the output given in \cref{lst:mycommand1-mlb5}. + + \begin{minipage}{.4\linewidth} + \cmhlistingsfromfile{demonstrations/mycommand1-mlb5.tex}{\texttt{mycommand1.tex} using \cref{lst:mycom-mlb5}}{lst:mycommand1-mlb5} + \end{minipage} + \hfill + \begin{minipage}{.55\linewidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/mycom-mlb5.yaml}[MLB-TCB,width=\linewidth]{\texttt{mycom-mlb5.yaml}}{lst:mycom-mlb5} + \end{minipage} + + As previously, the most-recently-processed code block takes priority -- as before, the second (i.e, \emph{last}) argument. + Exploring this further, we consider the YAML settings in \cref{lst:mycom-mlb6}, which give associated output in \cref{lst:mycommand1-mlb6}. + + \begin{minipage}{.4\linewidth} + \cmhlistingsfromfile{demonstrations/mycommand1-mlb6.tex}{\texttt{mycommand1.tex} using \cref{lst:mycom-mlb6}}{lst:mycommand1-mlb6} + \end{minipage} + \hfill + \begin{minipage}{.55\linewidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/mycom-mlb6.yaml}[MLB-TCB,width=\linewidth]{\texttt{mycom-mlb6.yaml}}{lst:mycom-mlb6} + \end{minipage} + + Note that a \lstinline!%! \emph{has} been added to the trailing first \lstinline!}!; this is because: \begin{itemize} \item while processing the \emph{first} argument, the trailing line break has been removed (\texttt{RCuBFinishesWithLineBreak} set to $-1$); + \item while processing the \emph{second} argument, \texttt{latexindent.pl} finds that it does \emph{not} begin on its own line, and so because \texttt{LCuBStartsOnOwnLine} is set to $2$, it adds a comment, followed by a line break. + \end{itemize} + +\subsection{Conflicting poly-switches: nested code blocks} + Now let's consider an example when nested code blocks have conflicting poly-switches; we'll use the code in \cref{lst:nested-env}, noting that it contains nested environments. + + \cmhlistingsfromfile{demonstrations/nested-env.tex}{\texttt{nested-env.tex}}{lst:nested-env} + + Let's use the YAML settings given in \cref{lst:nested-env-mlb1-yaml}, which upon running the command \begin{commandshell} +latexindent.pl -m -l=nested-env-mlb1.yaml nested-env.tex + \end{commandshell} gives the output in \cref{lst:nested-env-mlb1}. + + \begin{minipage}{.45\linewidth} + \cmhlistingsfromfile{demonstrations/nested-env-mlb1.tex}{\texttt{nested-env.tex} using \cref{lst:nested-env-mlb1-yaml}}{lst:nested-env-mlb1} + \end{minipage} + \hfill + \begin{minipage}{.55\linewidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/nested-env-mlb1.yaml}[MLB-TCB,width=\linewidth]{\texttt{nested-env-mlb1.yaml}}{lst:nested-env-mlb1-yaml} + \end{minipage} + + In \cref{lst:nested-env-mlb1}, let's first of all note that both environments have received the appropriate (default) indentation; secondly, note that the poly-switch \texttt{EndStartsOnOwnLine} appears to have won the conflict, as \lstinline!\end{one}! has had its leading line break removed. + + To understand it, let's talk about the three basic phases \label{page:phases}of \texttt{latexindent.pl}: + \begin{enumerate} + \item Phase 1: packing, in which code blocks are replaced with unique ids, working from \emph{the inside to the outside}, and then sequentially -- for example, in \cref{lst:nested-env}, the \texttt{two} environment is found \emph{before} the \texttt{one} environment; if the -m switch is active, then during this phase: \begin{itemize} \item line breaks at the beginning of the \texttt{body} can be added (if \texttt{BodyStartsOnOwnLine} is $1$ or $2$) or removed (if \texttt{BodyStartsOnOwnLine} is $-1$); + \item line breaks at the end of the body can be added (if \texttt{EndStartsOnOwnLine} is $1$ or $2$) or removed (if \texttt{EndStartsOnOwnLine} is $-1$); + \item line breaks after the end statement can be added (if \texttt{EndFinishesWithLineBreak} is $1$ or $2$). + \end{itemize} + \item Phase 2: indentation, in which white space is added to the begin, body, and end statements; + \item Phase 3: unpacking, in which unique ids are replaced by their \emph{indented} code blocks; if the -m switch is active, then during this phase, + \begin{itemize} + \item line breaks before \texttt{begin} statements can be added or removed (depending upon \texttt{BeginStartsOnOwnLine}); + \item line breaks after \emph{end} statements can be removed but \emph{NOT} added (see \texttt{EndFinishesWithLineBreak}). + \end{itemize} + \end{enumerate} + + With reference to \cref{lst:nested-env-mlb1}, this means that during Phase 1: \begin{itemize} \item the \texttt{two} environment is found first, and the line break ahead of the \lstinline!\end{two}! statement is removed because \texttt{EndStartsOnOwnLine} is set to $-1$. + Importantly, because, \emph{at this stage}, \lstinline!\end{two}! \emph{does} finish with a line break, \texttt{EndFinishesWithLineBreak} causes no action. + \item next, the \texttt{one} environment is found; the line break ahead of \lstinline!\end{one}! is removed because \texttt{EndStartsOnOwnLine} + is set to $-1$. + \end{itemize} + The indentation is done in Phase 2; in Phase 3 \emph{there is no option to add a line break after the \lstinline!end! statements}. + We can justify this by remembering that during Phase 3, the \texttt{one} environment will be found and processed first, followed by the \texttt{two} environment. + If the \texttt{two} environment were to add a line break after the \lstinline!\end{two}! statement, then \texttt{latexindent.pl} would have no way of knowing how much indentation to add to the subsequent text (in this case, \lstinline!\end{one}!). + + We can explore this further using the poly-switches in \cref{lst:nested-env-mlb2}; upon running the command \begin{commandshell} +latexindent.pl -m -l=nested-env-mlb2.yaml nested-env.tex + \end{commandshell} we obtain the output given in \cref{lst:nested-env-mlb2-output}. + + \begin{minipage}{.45\linewidth} + \cmhlistingsfromfile{demonstrations/nested-env-mlb2.tex}{\texttt{nested-env.tex} using \cref{lst:nested-env-mlb2}}{lst:nested-env-mlb2-output} + \end{minipage} + \hfill + \begin{minipage}{.55\linewidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/nested-env-mlb2.yaml}[MLB-TCB,width=\linewidth]{\texttt{nested-env-mlb2.yaml}}{lst:nested-env-mlb2} + \end{minipage} + + During Phase 1: \begin{itemize} \item the \texttt{two} environment is found first, and the line break ahead of the \lstinline!\end{two}! statement is not changed because \texttt{EndStartsOnOwnLine} is set to $1$. + Importantly, because, \emph{at this stage}, \lstinline!\end{two}! \emph{does} finish with a line break, \texttt{EndFinishesWithLineBreak} causes no action. + \item next, the \texttt{one} environment is found; the line break ahead of \lstinline!\end{one}! is already present, and no action is needed. + \end{itemize} + The indentation is done in Phase 2, and then in Phase 3, the \texttt{one} environment is found and processed first, followed by the \texttt{two} environment. + \emph{At this stage}, the \texttt{two} environment finds \texttt{EndFinishesWithLineBreak} is $-1$, so it removes + the trailing line break; remember, at this point, \texttt{latexindent.pl} has completely finished with the \texttt{one} environment. diff --git a/test-cases/documentation/subsec-noAdditionalIndent-indentRules-mod1.tex b/test-cases/documentation/subsec-noAdditionalIndent-indentRules-mod1.tex new file mode 100644 index 00000000..4e666a76 --- /dev/null +++ b/test-cases/documentation/subsec-noAdditionalIndent-indentRules-mod1.tex @@ -0,0 +1,19 @@ +% arara: pdflatex: {shell: yes, files: [latexindent]} +% arara: pdflatex: {shell: yes, files: [latexindent]} +\subsection{\texttt{noAdditionalIndent} and \texttt{indentRules}} + \label{sec:noadd-indent-rules} + \texttt{latexindent.pl} operates on files by looking for code blocks, as detailed in \vref{subsubsec:code-blocks}; for each type of code block in \vref{tab:code-blocks} (which we will call a \emph{$\langle$thing$\rangle$} in what follows) it searches YAML fields for information in the following order: + \begin{enumerate} + \item \texttt{noAdditionalIndent} for the \emph{name} of the current \emph{$\langle$thing$\rangle$}; + \item \texttt{indentRules} for the \emph{name} of the current \emph{$\langle$thing$\rangle$}; + \item \texttt{noAdditionalIndentGlobal} for the \emph{type} of the current \emph{$\langle$thing$\rangle$}; + \item \texttt{indentRulesGlobal} for the \emph{type} of the current \emph{$\langle$thing$\rangle$}. + \end{enumerate} + + Using the above list, the first piece of information to be found will be used; failing that, the value of \texttt{defaultIndent} is used. + If information is found in multiple fields, the first one according to the list above will be used; for example, if information is present in both \texttt{indentRules} and in \texttt{noAdditionalIndentGlobal}, then the information from \texttt{indentRules} takes priority. + + We now present details for the different type of code blocks known to \texttt{latexindent.pl}, as detailed in \vref{tab:code-blocks}; for reference, there follows a list of the code blocks covered. + + \startcontents[noAdditionalIndent] + \printcontents[noAdditionalIndent]{}{0}{} diff --git a/test-cases/documentation/subsec-partnering-poly-switches-mod1.tex b/test-cases/documentation/subsec-partnering-poly-switches-mod1.tex new file mode 100644 index 00000000..e2bd30ef --- /dev/null +++ b/test-cases/documentation/subsec-partnering-poly-switches-mod1.tex @@ -0,0 +1,39 @@ +% arara: pdflatex: {shell: yes, files: [latexindent]} +\subsection{Partnering \texttt{BodyStartsOnOwnLine} with argument-based poly-switches} + Some poly-switches need to be partnered together; in particular, when line breaks involving the \emph{first} argument of a code block need to be accounted for using both \texttt{BodyStartsOnOwnLine} (or its equivalent, see \vref{tab:poly-switch-mapping}) and \texttt{LCuBStartsOnOwnLine} for mandatory arguments, and \texttt{LSqBStartsOnOwnLine} for optional arguments. + + Let's begin with the code in \cref{lst:mycommand1} and the YAML settings in \cref{lst:mycom-mlb1}; with reference to \vref{tab:poly-switch-mapping}, the key \texttt{CommandNameFinishesWithLineBreak} is an alias for \texttt{BodyStartsOnOwnLine}. + + \cmhlistingsfromfile{demonstrations/mycommand1.tex}{\texttt{mycommand1.tex}}{lst:mycommand1} + + Upon running the command \begin{commandshell} +latexindent.pl -m -l=mycom-mlb1.yaml mycommand1.tex +\end{commandshell} we obtain \cref{lst:mycommand1-mlb1}; note that the \emph{second} mandatory argument beginning brace \lstinline!{! has had its leading line break removed, but that the \emph{first} brace has not. + + \begin{minipage}{.4\linewidth} + \cmhlistingsfromfile{demonstrations/mycommand1-mlb1.tex}{\texttt{mycommand1.tex} using \cref{lst:mycom-mlb1}}{lst:mycommand1-mlb1} + \end{minipage} + \hfill + \begin{minipage}{.55\linewidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/mycom-mlb1.yaml}[MLB-TCB,width=\linewidth]{\texttt{mycom-mlb1.yaml}}{lst:mycom-mlb1} + \end{minipage} + + Now let's change the YAML file so that it is as in \cref{lst:mycom-mlb2}; upon running the analogous command to that given above, we obtain \cref{lst:mycommand1-mlb2}; both beginning braces \lstinline!{! have had their leading line breaks removed. + + \begin{minipage}{.4\linewidth} + \cmhlistingsfromfile{demonstrations/mycommand1-mlb2.tex}{\texttt{mycommand1.tex} using \cref{lst:mycom-mlb2}}{lst:mycommand1-mlb2} + \end{minipage} + \hfill + \begin{minipage}{.55\linewidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/mycom-mlb2.yaml}[MLB-TCB,width=\linewidth]{\texttt{mycom-mlb2.yaml}}{lst:mycom-mlb2} + \end{minipage} + + Now let's change the YAML file so that it is as in \cref{lst:mycom-mlb3}; upon running the analogous command to that given above, we obtain \cref{lst:mycommand1-mlb3}. + + \begin{minipage}{.4\linewidth} + \cmhlistingsfromfile{demonstrations/mycommand1-mlb3.tex}{\texttt{mycommand1.tex} using \cref{lst:mycom-mlb3}}{lst:mycommand1-mlb3} + \end{minipage} + \hfill + \begin{minipage}{.55\linewidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/mycom-mlb3.yaml}[MLB-TCB,width=\linewidth]{\texttt{mycom-mlb3.yaml}}{lst:mycom-mlb3} + \end{minipage} diff --git a/test-cases/documentation/subsubsec-commands-with-arguments-mod1.tex b/test-cases/documentation/subsubsec-commands-with-arguments-mod1.tex new file mode 100644 index 00000000..939f0baf --- /dev/null +++ b/test-cases/documentation/subsubsec-commands-with-arguments-mod1.tex @@ -0,0 +1,87 @@ +% arara: pdflatex: {shell: yes, files: [latexindent]} +\subsubsection{Commands with arguments}\label{subsubsec:commands-arguments} + Let's begin with the simple example in \cref{lst:mycommand}; when \texttt{latexindent.pl} operates on this file, the default output is shown in \cref{lst:mycommand-default}. + \footnote{The command code blocks + have quite a few subtleties, described in \vref{subsec:commands-string-between}.} + + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile{demonstrations/mycommand.tex}{\texttt{mycommand.tex}}{lst:mycommand} + \end{minipage}% + \hfill + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile{demonstrations/mycommand-default.tex}{\texttt{mycommand.tex} default output}{lst:mycommand-default} + \end{minipage} + + As in the environment-based case (see \vref{lst:myenv-noAdd1,lst:myenv-noAdd2}) we may specify \texttt{noAdditionalIndent} either in `scalar' form, or in `field' form, as shown in \cref{lst:mycommand-noAdd1,lst:mycommand-noAdd2} + + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/mycommand-noAdd1.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{mycommand-noAdd1.yaml}}{lst:mycommand-noAdd1} + \end{minipage} \hfill + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/mycommand-noAdd2.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{mycommand-noAdd2.yaml}}{lst:mycommand-noAdd2} + \end{minipage} + + After running the following commands, \begin{commandshell} +latexindent.pl mycommand.tex -l mycommand-noAdd1.yaml +latexindent.pl mycommand.tex -l mycommand-noAdd2.yaml +\end{commandshell} we receive the respective output given in \cref{lst:mycommand-output-noAdd1,lst:mycommand-output-noAdd2} + + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile{demonstrations/mycommand-noAdd1.tex}{\texttt{mycommand.tex} using \cref{lst:mycommand-noAdd1}}{lst:mycommand-output-noAdd1} + \end{minipage} \hfill + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile{demonstrations/mycommand-noAdd2.tex}{\texttt{mycommand.tex} using \cref{lst:mycommand-noAdd2}}{lst:mycommand-output-noAdd2} + \end{minipage} + + Note that in \cref{lst:mycommand-output-noAdd1} that the `body', optional argument \emph{and} mandatory argument have \emph{all} received no additional indentation, while in \cref{lst:mycommand-output-noAdd2}, only the `body' has not received any additional indentation. + We define the `body' of a command as any lines following the command name that include its optional or mandatory arguments. + + We may further customise \texttt{noAdditionalIndent} for \texttt{mycommand} as we did in \vref{lst:myenv-noAdd5,lst:myenv-noAdd6}; explicit examples are given in \cref{lst:mycommand-noAdd3,lst:mycommand-noAdd4}. + + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/mycommand-noAdd3.yaml}[width=.9\linewidth,before=\centering,yaml-TCB]{\texttt{mycommand-noAdd3.yaml}}{lst:mycommand-noAdd3} + \end{minipage} + \hfill + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/mycommand-noAdd4.yaml}[width=.9\linewidth,before=\centering,yaml-TCB]{\texttt{mycommand-noAdd4.yaml}}{lst:mycommand-noAdd4} + \end{minipage} + + After running the following commands, \begin{commandshell} +latexindent.pl mycommand.tex -l mycommand-noAdd3.yaml +latexindent.pl mycommand.tex -l mycommand-noAdd4.yaml +\end{commandshell} we receive the respective output given in \cref{lst:mycommand-output-noAdd3,lst:mycommand-output-noAdd4}. + + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile{demonstrations/mycommand-noAdd3.tex}{\texttt{mycommand.tex} using \cref{lst:mycommand-noAdd3}}{lst:mycommand-output-noAdd3} + \end{minipage} + \hfill + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile{demonstrations/mycommand-noAdd4.tex}{\texttt{mycommand.tex} using \cref{lst:mycommand-noAdd4}}{lst:mycommand-output-noAdd4} + \end{minipage} + + Attentive readers will note that the body of \texttt{mycommand} in both \cref{lst:mycommand-output-noAdd3,lst:mycommand-output-noAdd4} has received no additional indent, even though \texttt{body} is explicitly set to \texttt{0} in both \cref{lst:mycommand-noAdd3,lst:mycommand-noAdd4}. + This is because, by default, \texttt{noAdditionalIndentGlobal} for \texttt{commands} is set to \texttt{1} by default; this can be easily fixed as in \cref{lst:mycommand-noAdd5,lst:mycommand-noAdd6}. + \label{page:command:noAddGlobal} + + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/mycommand-noAdd5.yaml}[width=.9\linewidth,before=\centering,yaml-TCB]{\texttt{mycommand-noAdd5.yaml}}{lst:mycommand-noAdd5} + \end{minipage} + \hfill + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/mycommand-noAdd6.yaml}[width=.9\linewidth,before=\centering,yaml-TCB]{\texttt{mycommand-noAdd6.yaml}}{lst:mycommand-noAdd6} + \end{minipage} + + After running the following commands, \begin{commandshell} +latexindent.pl mycommand.tex -l mycommand-noAdd5.yaml +latexindent.pl mycommand.tex -l mycommand-noAdd6.yaml +\end{commandshell} we receive the respective output given in \cref{lst:mycommand-output-noAdd5,lst:mycommand-output-noAdd6}. + + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile{demonstrations/mycommand-noAdd5.tex}{\texttt{mycommand.tex} using \cref{lst:mycommand-noAdd5}}{lst:mycommand-output-noAdd5} + \end{minipage} + \hfill + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile{demonstrations/mycommand-noAdd6.tex}{\texttt{mycommand.tex} using \cref{lst:mycommand-noAdd6}}{lst:mycommand-output-noAdd6} + \end{minipage} + + Both \texttt{indentRules} and \texttt{indentRulesGlobal} can be adjusted as they were for \emph{environment} code blocks, as in \vref{lst:myenv-rules3,lst:myenv-rules4} and \vref{lst:indentRulesGlobal:environments,lst:opt-args-indent-rules-glob,lst:mand-args-indent-rules-glob}. diff --git a/test-cases/documentation/subsubsec-environments-and-their-arguments-mod1.tex b/test-cases/documentation/subsubsec-environments-and-their-arguments-mod1.tex new file mode 100644 index 00000000..eba168a5 --- /dev/null +++ b/test-cases/documentation/subsubsec-environments-and-their-arguments-mod1.tex @@ -0,0 +1,215 @@ +% arara: pdflatex: {shell: yes, files: [latexindent]} +\subsubsection{Environments and their arguments}\label{subsubsec:env-and-their-args} + There are a few different YAML switches governing the indentation of environments; let's start with the code shown in \cref{lst:myenvtex}. + + \cmhlistingsfromfile{demonstrations/myenvironment-simple.tex}{\texttt{myenv.tex}}{lst:myenvtex} + +\yamltitle{noAdditionalIndent}*{fields} + If we do not wish \texttt{myenv} to receive any additional indentation, we have a few choices available to us, as demonstrated in \cref{lst:myenv-noAdd1,lst:myenv-noAdd2}. + + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/myenv-noAdd1.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{myenv-noAdd1.yaml}}{lst:myenv-noAdd1} + \end{minipage} + \hfill + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/myenv-noAdd2.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{myenv-noAdd2.yaml}}{lst:myenv-noAdd2} + \end{minipage} + + On applying either of the following commands, \begin{commandshell} +latexindent.pl myenv.tex -l myenv-noAdd1.yaml +latexindent.pl myenv.tex -l myenv-noAdd2.yaml +\end{commandshell} we obtain the output given in \cref{lst:myenv-output}; note in particular that the environment \texttt{myenv} has not received any \emph{additional} indentation, but that the \texttt{outer} environment \emph{has} still received indentation. + + \cmhlistingsfromfile{demonstrations/myenvironment-simple-noAdd-body1.tex}{\texttt{myenv.tex output (using either \cref{lst:myenv-noAdd1} or \cref{lst:myenv-noAdd2})}}{lst:myenv-output} + + Upon changing the YAML files to those shown in \cref{lst:myenv-noAdd3,lst:myenv-noAdd4}, and running either \begin{commandshell} +latexindent.pl myenv.tex -l myenv-noAdd3.yaml +latexindent.pl myenv.tex -l myenv-noAdd4.yaml +\end{commandshell} we obtain the output given in \cref{lst:myenv-output-4}. + + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/myenv-noAdd3.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{myenv-noAdd3.yaml}}{lst:myenv-noAdd3} + \end{minipage} + \hfill + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/myenv-noAdd4.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{myenv-noAdd4.yaml}}{lst:myenv-noAdd4} + \end{minipage} + + \cmhlistingsfromfile{demonstrations/myenvironment-simple-noAdd-body4.tex}{\texttt{myenv.tex output} (using either \cref{lst:myenv-noAdd3} or \cref{lst:myenv-noAdd4})}{lst:myenv-output-4} + + Let's now allow \texttt{myenv} to have some optional and mandatory arguments, as in \cref{lst:myenv-args}. + \cmhlistingsfromfile{demonstrations/myenvironment-args.tex}{\texttt{myenv-args.tex}}{lst:myenv-args} + Upon running \begin{commandshell} +latexindent.pl -l=myenv-noAdd1.yaml myenv-args.tex +\end{commandshell} we obtain the output shown in \cref{lst:myenv-args-noAdd1}; note that the optional argument, mandatory argument and body \emph{all} have received no additional indent. + This is because, when \texttt{noAdditionalIndent} is specified in `scalar' form (as in \cref{lst:myenv-noAdd1}), then \emph{all} parts of the environment (body, optional and mandatory arguments) are assumed to want no additional indent. + \cmhlistingsfromfile{demonstrations/myenvironment-args-noAdd-body1.tex}{\texttt{myenv-args.tex} using \cref{lst:myenv-noAdd1}}{lst:myenv-args-noAdd1} + + We may customise \texttt{noAdditionalIndent} for optional and mandatory arguments of the \texttt{myenv} environment, as shown in, for example, \cref{lst:myenv-noAdd5,lst:myenv-noAdd6}. + + \begin{minipage}{.49\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/myenv-noAdd5.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{myenv-noAdd5.yaml}}{lst:myenv-noAdd5} + \end{minipage} + \hfill + \begin{minipage}{.49\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/myenv-noAdd6.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{myenv-noAdd6.yaml}}{lst:myenv-noAdd6} + \end{minipage} + + Upon running \begin{commandshell} +latexindent.pl myenv.tex -l myenv-noAdd5.yaml +latexindent.pl myenv.tex -l myenv-noAdd6.yaml +\end{commandshell} we obtain the respective outputs given in \cref{lst:myenv-args-noAdd5,lst:myenv-args-noAdd6}. + Note that in \cref{lst:myenv-args-noAdd5} the text for the \emph{optional} argument has not received any additional indentation, and that in \cref{lst:myenv-args-noAdd6} the \emph{mandatory} argument has not received any additional indentation; in both cases, the \emph{body} has not received any additional indentation. + + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile{demonstrations/myenvironment-args-noAdd5.tex}{\texttt{myenv-args.tex} using \cref{lst:myenv-noAdd5}}{lst:myenv-args-noAdd5} + \end{minipage} + \hfill + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile{demonstrations/myenvironment-args-noAdd6.tex}{\texttt{myenv-args.tex} using \cref{lst:myenv-noAdd6}}{lst:myenv-args-noAdd6} + \end{minipage} + +\yamltitle{indentRules}*{fields} + We may also specify indentation rules for environment code blocks using the \texttt{indentRules} field; see, for example, \cref{lst:myenv-rules1,lst:myenv-rules2}. + + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/myenv-rules1.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{myenv-rules1.yaml}}{lst:myenv-rules1} + \end{minipage} + \hfill + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/myenv-rules2.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{myenv-rules2.yaml}}{lst:myenv-rules2} + \end{minipage} + + On applying either of the following commands, \begin{commandshell} +latexindent.pl myenv.tex -l myenv-rules1.yaml +latexindent.pl myenv.tex -l myenv-rules2.yaml +\end{commandshell} we obtain the output given in \cref{lst:myenv-rules-output}; note in particular that the environment \texttt{myenv} has received one tab (from the \texttt{outer} environment) plus three spaces from \cref{lst:myenv-rules1} or \ref{lst:myenv-rules2}. + + \cmhlistingsfromfile[showtabs=true,showspaces=true]{demonstrations/myenv-rules1.tex}{\texttt{myenv.tex output (using either \cref{lst:myenv-rules1} or \cref{lst:myenv-rules2})}}{lst:myenv-rules-output} + + If you specify a field in \texttt{indentRules} using anything other than horizontal space, it will be ignored. + + Returning to the example in \cref{lst:myenv-args} that contains optional and mandatory arguments. + Upon using \cref{lst:myenv-rules1} as in \begin{commandshell} +latexindent.pl myenv-args.tex -l=myenv-rules1.yaml +\end{commandshell} we obtain the output in \cref{lst:myenv-args-rules1}; note that the body, optional argument and mandatory argument of \texttt{myenv} have \emph{all} received the same customised indentation. + \cmhlistingsfromfile[showtabs=true,showspaces=true]{demonstrations/myenvironment-args-rules1.tex}{\texttt{myenv-args.tex} using \cref{lst:myenv-rules1}}{lst:myenv-args-rules1} + + You can specify different indentation rules for the different features using, for example, \cref{lst:myenv-rules3,lst:myenv-rules4} + + \begin{minipage}{.49\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/myenv-rules3.yaml}[width=.9\linewidth,before=\centering,yaml-TCB]{\texttt{myenv-rules3.yaml}}{lst:myenv-rules3} + \end{minipage} \hfill + \begin{minipage}{.49\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/myenv-rules4.yaml}[width=.9\linewidth,before=\centering,yaml-TCB]{\texttt{myenv-rules4.yaml}}{lst:myenv-rules4} + \end{minipage} + + After running \begin{commandshell} +latexindent.pl myenv-args.tex -l myenv-rules3.yaml +latexindent.pl myenv-args.tex -l myenv-rules4.yaml +\end{commandshell} then we obtain the respective outputs given in \cref{lst:myenv-args-rules3,lst:myenv-args-rules4}. + + \begin{widepage} + \begin{minipage}{.5\textwidth} + \cmhlistingsfromfile[showtabs=true,showspaces=true]{demonstrations/myenvironment-args-rules3.tex}{\texttt{myenv-args.tex} using \cref{lst:myenv-rules3}}{lst:myenv-args-rules3} + \end{minipage}% + \hfill + \begin{minipage}{.5\textwidth} + \cmhlistingsfromfile[showtabs=true,showspaces=true]{demonstrations/myenvironment-args-rules4.tex}{\texttt{myenv-args.tex} using \cref{lst:myenv-rules4}}{lst:myenv-args-rules4} + \end{minipage} + \end{widepage} + + Note that in \cref{lst:myenv-args-rules3}, the optional argument has only received a single space of indentation, while the mandatory argument has received the default (tab) indentation; the environment body has received three spaces of indentation. + + In \cref{lst:myenv-args-rules4}, the optional argument has received the default (tab) indentation, the mandatory argument has received two tabs of indentation, and the body has received three spaces of indentation. + +\yamltitle{noAdditionalIndentGlobal}*{fields} + \begin{wrapfigure}[6]{r}[0pt]{7cm} + \cmhlistingsfromfile[style=noAdditionalIndentGlobalEnv]*{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{noAdditionalIndentGlobal}}{lst:noAdditionalIndentGlobal:environments} + \end{wrapfigure} + Assuming that your environment name is not found within neither \texttt{noAdditionalIndent} nor \texttt{indentRules}, the next place that \texttt{latexindent.pl} will look is \texttt{noAdditionalIndentGlobal}, and in particular \emph{for the environments} key (see \cref{lst:noAdditionalIndentGlobal:environments}). + Let's say that you change the value of \texttt{environments} to \texttt{1} in \cref{lst:noAdditionalIndentGlobal:environments}, and that you run + + \begin{widepage} \begin{commandshell} +latexindent.pl myenv-args.tex -l env-noAdditionalGlobal.yaml +latexindent.pl myenv-args.tex -l myenv-rules1.yaml,env-noAdditionalGlobal.yaml +\end{commandshell} \end{widepage} + + The respective output from these two commands are in \cref{lst:myenv-args-no-add-global1,lst:myenv-args-no-add-global2}; in \cref{lst:myenv-args-no-add-global1} notice that \emph{both} environments receive no additional indentation but that the arguments of \texttt{myenv} still \emph{do} receive indentation. + In \cref{lst:myenv-args-no-add-global2} notice that the \emph{outer} environment does not receive additional indentation, but because of the settings from \texttt{myenv-rules1.yaml} (in \vref{lst:myenv-rules1}), the \texttt{myenv} environment still \emph{does} receive indentation. + + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile{demonstrations/myenvironment-args-rules1-noAddGlobal1.tex}{\texttt{myenv-args.tex} using \cref{lst:noAdditionalIndentGlobal:environments}}{lst:myenv-args-no-add-global1} + \end{minipage} + \hfill + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile{demonstrations/myenvironment-args-rules1-noAddGlobal2.tex}{\texttt{myenv-args.tex} using \cref{lst:noAdditionalIndentGlobal:environments,lst:myenv-rules1}}{lst:myenv-args-no-add-global2} + \end{minipage} + + In fact, \texttt{noAdditionalIndentGlobal} also contains keys that control the indentation of optional and mandatory arguments; on referencing \cref{lst:opt-args-no-add-glob,lst:mand-args-no-add-glob} + + \begin{minipage}{.49\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/opt-args-no-add-glob.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{opt-args-no-add-glob.yaml}}{lst:opt-args-no-add-glob} + \end{minipage} \hfill + \begin{minipage}{.49\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/mand-args-no-add-glob.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{mand-args-no-add-glob.yaml}}{lst:mand-args-no-add-glob} + \end{minipage} + + we may run the commands \begin{commandshell} +latexindent.pl myenv-args.tex -local opt-args-no-add-glob.yaml +latexindent.pl myenv-args.tex -local mand-args-no-add-glob.yaml +\end{commandshell} which produces the respective outputs given in \cref{lst:myenv-args-no-add-opt,lst:myenv-args-no-add-mand}. + Notice that in \cref{lst:myenv-args-no-add-opt} the \emph{optional} argument has not received any additional indentation, and in \cref{lst:myenv-args-no-add-mand} the \emph{mandatory} argument has not received any additional indentation. + + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile{demonstrations/myenvironment-args-rules1-noAddGlobal3.tex}{\texttt{myenv-args.tex} using \cref{lst:opt-args-no-add-glob}}{lst:myenv-args-no-add-opt} + \end{minipage} + \hfill + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile{demonstrations/myenvironment-args-rules1-noAddGlobal4.tex}{\texttt{myenv-args.tex} using \cref{lst:mand-args-no-add-glob}}{lst:myenv-args-no-add-mand} + \end{minipage} + +\yamltitle{indentRulesGlobal}*{fields} + \begin{wrapfigure}[4]{r}[0pt]{7cm} + \cmhlistingsfromfile[style=indentRulesGlobalEnv]*{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{indentRulesGlobal}}{lst:indentRulesGlobal:environments} + \end{wrapfigure} + The final check that \texttt{latexindent.pl} will make is to look for \texttt{indentRulesGlobal} as detailed in \cref{lst:indentRulesGlobal:environments}; if you change the \texttt{environments} field to anything involving horizontal space, say \lstinline!" "!, and then run the following commands + + \begin{commandshell} +latexindent.pl myenv-args.tex -l env-indentRules.yaml +latexindent.pl myenv-args.tex -l myenv-rules1.yaml,env-indentRules.yaml +\end{commandshell} then the respective output is shown in \cref{lst:myenv-args-indent-rules-global1,lst:myenv-args-indent-rules-global2}. + Note that in \cref{lst:myenv-args-indent-rules-global1}, both the environment blocks have received a single-space indentation, whereas in \cref{lst:myenv-args-indent-rules-global2} the \texttt{outer} environment has received single-space indentation (specified by \texttt{indentRulesGlobal}), but \texttt{myenv} has received \lstinline!" "!, as specified by the particular \texttt{indentRules} for \texttt{myenv} \vref{lst:myenv-rules1}. + + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile[showspaces=true]{demonstrations/myenvironment-args-global-rules1.tex}{\texttt{myenv-args.tex} using \cref{lst:indentRulesGlobal:environments}}{lst:myenv-args-indent-rules-global1} + \end{minipage} + \hfill + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile[showspaces=true]{demonstrations/myenvironment-args-global-rules2.tex}{\texttt{myenv-args.tex} using \cref{lst:myenv-rules1,lst:indentRulesGlobal:environments}}{lst:myenv-args-indent-rules-global2} + \end{minipage} + + You can specify \texttt{indentRulesGlobal} for both optional and mandatory arguments, as detailed in \cref{lst:opt-args-indent-rules-glob,lst:mand-args-indent-rules-glob} + + \begin{minipage}{.49\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/opt-args-indent-rules-glob.yaml}[width=.9\linewidth,before=\centering,yaml-TCB]{\texttt{opt-args-indent-rules-glob.yaml}}{lst:opt-args-indent-rules-glob} + \end{minipage} \hfill + \begin{minipage}{.49\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/mand-args-indent-rules-glob.yaml}[width=.9\linewidth,before=\centering,yaml-TCB]{\texttt{mand-args-indent-rules-glob.yaml}}{lst:mand-args-indent-rules-glob} + \end{minipage} + + Upon running the following commands \begin{commandshell} +latexindent.pl myenv-args.tex -local opt-args-indent-rules-glob.yaml +latexindent.pl myenv-args.tex -local mand-args-indent-rules-glob.yaml +\end{commandshell} we obtain the respective outputs in \cref{lst:myenv-args-indent-rules-global3,lst:myenv-args-indent-rules-global4}. + Note that the \emph{optional} argument in \cref{lst:myenv-args-indent-rules-global3} has received two tabs worth of indentation, while the \emph{mandatory} argument has done so in \cref{lst:myenv-args-indent-rules-global4}. + + \begin{widepage} + \begin{minipage}{.55\textwidth} + \cmhlistingsfromfile[showtabs=true]{demonstrations/myenvironment-args-global-rules3.tex}{\texttt{myenv-args.tex} using \cref{lst:opt-args-indent-rules-glob}}{lst:myenv-args-indent-rules-global3} + \end{minipage} + \hfill + \begin{minipage}{.55\textwidth} + \cmhlistingsfromfile[showtabs=true]{demonstrations/myenvironment-args-global-rules4.tex}{\texttt{myenv-args.tex} using \cref{lst:mand-args-indent-rules-glob}}{lst:myenv-args-indent-rules-global4} + \end{minipage} + \end{widepage} diff --git a/test-cases/documentation/subsubsec-environments-with-items-mod1.tex b/test-cases/documentation/subsubsec-environments-with-items-mod1.tex new file mode 100644 index 00000000..75ff0755 --- /dev/null +++ b/test-cases/documentation/subsubsec-environments-with-items-mod1.tex @@ -0,0 +1,43 @@ +% arara: pdflatex: {shell: yes, files: [latexindent]} +\subsubsection{Environments with items} + With reference to \vref{lst:indentafteritems,lst:itemNames}, some commands may contain \texttt{item} commands; for the purposes of this discussion, we will use the code from \vref{lst:itemsbefore}. + + Assuming that you've populated \texttt{itemNames} with the name of your \texttt{item}, you can put the item name into \texttt{noAdditionalIndent} as in \cref{lst:item-noAdd1}, although a more efficient approach may be to change the relevant field in \texttt{itemNames} to \texttt{0}. + Similarly, you can customise the indentation that your \texttt{item} receives using \texttt{indentRules}, as in \cref{lst:item-rules1} + + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/item-noAdd1.yaml}[yaml-TCB]{\texttt{item-noAdd1.yaml}}{lst:item-noAdd1} + \end{minipage} \hfill + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/item-rules1.yaml}[yaml-TCB]{\texttt{item-rules1.yaml}}{lst:item-rules1} + \end{minipage} + + Upon running the following commands \begin{commandshell} +latexindent.pl items1.tex -local item-noAdd1.yaml +latexindent.pl items1.tex -local item-rules1.yaml +\end{commandshell} the respective outputs are given in \cref{lst:items1-noAdd1,lst:items1-rules1}; note that in \cref{lst:items1-noAdd1} that the text after each \texttt{item} has not received any additional indentation, and in \cref{lst:items1-rules1}, the text after each \texttt{item} has received a single space of indentation, specified by \cref{lst:item-rules1}. + % + + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile{demonstrations/items1-noAdd1.tex}{\texttt{items1.tex} using \cref{lst:item-noAdd1}}{lst:items1-noAdd1} + \end{minipage} + \hfill + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile[showtabs=true,showspaces=true]{demonstrations/items1-rules1.tex}{\texttt{items1.tex} using \cref{lst:item-rules1}}{lst:items1-rules1} + \end{minipage} + + Alternatively, you might like to populate \texttt{noAdditionalIndentGlobal} or \texttt{indentRulesGlobal} using the \texttt{items} key, as demonstrated in \cref{lst:items-noAdditionalGlobal,lst:items-indentRulesGlobal}. + Note that there is a need to `reset/remove' the \texttt{item} field from \texttt{indentRules} in both cases (see the hierarchy description given on \cpageref{sec:noadd-indent-rules}) as the \texttt{item} command is a member of \texttt{indentRules} by default. + + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/items-noAdditionalGlobal.yaml}[yaml-TCB]{\texttt{items-noAdditionalGlobal.yaml}}{lst:items-noAdditionalGlobal} + \end{minipage}% + \hfill + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/items-indentRulesGlobal.yaml}[yaml-TCB]{\texttt{items-indentRulesGlobal.yaml}}{lst:items-indentRulesGlobal} + \end{minipage} + + Upon running the following commands, \begin{commandshell} +latexindent.pl items1.tex -local items-noAdditionalGlobal.yaml +latexindent.pl items1.tex -local items-indentRulesGlobal.yaml +\end{commandshell} the respective outputs from \cref{lst:items1-noAdd1,lst:items1-rules1} are obtained; note, however, that \emph{all} such \texttt{item} commands without their own individual \texttt{noAdditionalIndent} or \texttt{indentRules} settings would behave as in these listings. diff --git a/test-cases/documentation/subsubsec-headings-mod1.tex b/test-cases/documentation/subsubsec-headings-mod1.tex new file mode 100644 index 00000000..726c2dd6 --- /dev/null +++ b/test-cases/documentation/subsubsec-headings-mod1.tex @@ -0,0 +1,82 @@ +% arara: pdflatex: {shell: yes, files: [latexindent]} +\subsubsection{\texttt{afterHeading} code blocks}\label{subsubsec-headings-no-add-indent-rules} + Let's use the example \cref{lst:headings2} for demonstration throughout this \namecref{subsubsec-headings-no-add-indent-rules}. + As discussed on \cpageref{lst:headings1}, by default \texttt{latexindent.pl} will not add indentation after headings. + + \cmhlistingsfromfile{demonstrations/headings2.tex}{\texttt{headings2.tex}}{lst:headings2} + + On using the YAML file in \cref{lst:headings3yaml} by running the command \begin{commandshell} +latexindent.pl headings2.tex -l headings3.yaml + \end{commandshell} we obtain the output in \cref{lst:headings2-mod3}. + Note that the argument of \texttt{paragraph} has received (default) indentation, and that the body after the heading statement has received (default) indentation. + + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile{demonstrations/headings2-mod3.tex}{\texttt{headings2.tex} using \cref{lst:headings3yaml}}{lst:headings2-mod3} + \end{minipage}% + \hfill + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/headings3.yaml}[yaml-TCB]{\texttt{headings3.yaml}}{lst:headings3yaml} + \end{minipage} + + If we specify \texttt{noAdditionalIndent} as in \cref{lst:headings4yaml} and run the command \begin{commandshell} +latexindent.pl headings2.tex -l headings4.yaml + \end{commandshell} then we receive the output in \cref{lst:headings2-mod4}. + Note that the arguments \emph{and} the body after the heading of \texttt{paragraph} has received no additional indentation, because we have specified \texttt{noAdditionalIndent} in scalar form. + + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile{demonstrations/headings2-mod4.tex}{\texttt{headings2.tex} using \cref{lst:headings4yaml}}{lst:headings2-mod4} + \end{minipage}% + \hfill + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/headings4.yaml}[yaml-TCB]{\texttt{headings4.yaml}}{lst:headings4yaml} + \end{minipage} + + Similarly, if we specify \texttt{indentRules} as in \cref{lst:headings5yaml} and run analogous commands to those above, we receive the output in \cref{lst:headings2-mod5}; note that the \emph{body}, \emph{mandatory argument} and content \emph{after the heading} of \texttt{paragraph} have \emph{all} received three tabs worth of indentation. + + \begin{minipage}{.55\textwidth} + \cmhlistingsfromfile[showtabs=true]{demonstrations/headings2-mod5.tex}{\texttt{headings2.tex} using \cref{lst:headings5yaml}}{lst:headings2-mod5} + \end{minipage}% + \hfill + \begin{minipage}{.42\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/headings5.yaml}[yaml-TCB]{\texttt{headings5.yaml}}{lst:headings5yaml} + \end{minipage} + + We may, instead, specify \texttt{noAdditionalIndent} in `field' form, as in \cref{lst:headings6yaml} which gives the output in \cref{lst:headings2-mod6}. + + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile{demonstrations/headings2-mod6.tex}{\texttt{headings2.tex} using \cref{lst:headings6yaml}}{lst:headings2-mod6} + \end{minipage}% + \hfill + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/headings6.yaml}[yaml-TCB]{\texttt{headings6.yaml}}{lst:headings6yaml} + \end{minipage} + + Analogously, we may specify \texttt{indentRules} as in \cref{lst:headings7yaml} which gives the output in \cref{lst:headings2-mod7}; note that mandatory argument text has only received a single space of indentation, while the body after the heading has received three tabs worth of indentation. + + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile[showtabs=true]{demonstrations/headings2-mod7.tex}{\texttt{headings2.tex} using \cref{lst:headings7yaml}}{lst:headings2-mod7} + \end{minipage}% + \hfill + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/headings7.yaml}[yaml-TCB]{\texttt{headings7.yaml}}{lst:headings7yaml} + \end{minipage} + + Finally, let's consider \texttt{noAdditionalIndentGlobal} and \texttt{indentRulesGlobal} shown in \cref{lst:headings8yaml,lst:headings9yaml} respectively, with respective output in \cref{lst:headings2-mod8,lst:headings2-mod9}. + Note that in \cref{lst:headings8yaml} the \emph{mandatory argument} of \texttt{paragraph} has received a (default) tab's worth of indentation, while the body after the heading has received \emph{no additional indentation}. + Similarly, in \cref{lst:headings2-mod9}, the \emph{argument} has received both a (default) tab plus two spaces of indentation (from the global rule specified in \cref{lst:headings9yaml}), and the remaining body after \texttt{paragraph} has received just two spaces of indentation. + + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile{demonstrations/headings2-mod8.tex}{\texttt{headings2.tex} using \cref{lst:headings8yaml}}{lst:headings2-mod8} + \end{minipage}% + \hfill + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/headings8.yaml}[yaml-TCB]{\texttt{headings8.yaml}}{lst:headings8yaml} + \end{minipage} + + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile[showspaces=true,showtabs=true]{demonstrations/headings2-mod9.tex}{\texttt{headings2.tex} using \cref{lst:headings9yaml}}{lst:headings2-mod9} + \end{minipage}% + \hfill + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/headings9.yaml}[yaml-TCB]{\texttt{headings9.yaml}}{lst:headings9yaml} + \end{minipage} diff --git a/test-cases/documentation/subsubsec-ifelsefi-mod1.tex b/test-cases/documentation/subsubsec-ifelsefi-mod1.tex new file mode 100644 index 00000000..0136b7a7 --- /dev/null +++ b/test-cases/documentation/subsubsec-ifelsefi-mod1.tex @@ -0,0 +1,58 @@ +% arara: pdflatex: {shell: yes, files: [latexindent]} +\subsubsection{ifelsefi code blocks} + Let's use the simple example shown in \cref{lst:ifelsefi1}; when \texttt{latexindent.pl} operates on this file, the output as in \cref{lst:ifelsefi1-default}; note that the body of each of the \lstinline!\if! statements have been indented, and that the \lstinline!\else! statement has been accounted for correctly. + + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile{demonstrations/ifelsefi1.tex}{\texttt{ifelsefi1.tex}}{lst:ifelsefi1} + \end{minipage}% + \hfill + \begin{minipage}{.54\textwidth} + \cmhlistingsfromfile{demonstrations/ifelsefi1-default.tex}{\texttt{ifelsefi1.tex} default output}{lst:ifelsefi1-default} + \end{minipage} + + It is recommended to specify \texttt{noAdditionalIndent} and \texttt{indentRules} in the `scalar' form only for these type of code blocks, although the `field' form would work, assuming that \texttt{body} was specified. + Examples are shown in \cref{lst:ifnum-noAdd,lst:ifnum-indent-rules}. + + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/ifnum-noAdd.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{ifnum-noAdd.yaml}}{lst:ifnum-noAdd} + \end{minipage} + \hfill + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/ifnum-indent-rules.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{ifnum-indent-rules.yaml}}{lst:ifnum-indent-rules} + \end{minipage} + + After running the following commands, \begin{commandshell} +latexindent.pl ifelsefi1.tex -local ifnum-noAdd.yaml +latexindent.pl ifelsefi1.tex -l ifnum-indent-rules.yaml +\end{commandshell} we receive the respective output given in \cref{lst:ifelsefi1-output-noAdd,lst:ifelsefi1-output-indent-rules}; note that in \cref{lst:ifelsefi1-output-noAdd}, the \texttt{ifnum} code block has \emph{not} received any additional indentation, while in \cref{lst:ifelsefi1-output-indent-rules}, the \texttt{ifnum} code block has received one tab and two spaces of indentation. + + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile{demonstrations/ifelsefi1-noAdd.tex}{\texttt{ifelsefi1.tex} using \cref{lst:ifnum-noAdd}}{lst:ifelsefi1-output-noAdd} + \end{minipage} + \hfill + \begin{minipage}{.5\textwidth} + \cmhlistingsfromfile[showspaces=true,showtabs=true]{demonstrations/ifelsefi1-indent-rules.tex}{\texttt{ifelsefi1.tex} using \cref{lst:ifnum-indent-rules}}{lst:ifelsefi1-output-indent-rules} + \end{minipage} + + We may specify \texttt{noAdditionalIndentGlobal} and \texttt{indentRulesGlobal} as in \cref{lst:ifelsefi-noAdd-glob,lst:ifelsefi-indent-rules-global}. + + \begin{minipage}{.49\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/ifelsefi-noAdd-glob.yaml}[width=.9\linewidth,before=\centering,yaml-TCB]{\texttt{ifelsefi-noAdd-glob.yaml}}{lst:ifelsefi-noAdd-glob} + \end{minipage} + \hfill + \begin{minipage}{.49\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/ifelsefi-indent-rules-global.yaml}[width=.9\linewidth,before=\centering,yaml-TCB]{\texttt{ifelsefi-indent-rules-global.yaml}}{lst:ifelsefi-indent-rules-global} + \end{minipage} + + Upon running the following commands \begin{commandshell} +latexindent.pl ifelsefi1.tex -local ifelsefi-noAdd-glob.yaml +latexindent.pl ifelsefi1.tex -l ifelsefi-indent-rules-global.yaml +\end{commandshell} we receive the outputs in \cref{lst:ifelsefi1-output-noAdd-glob,lst:ifelsefi1-output-indent-rules-global}; notice that in \cref{lst:ifelsefi1-output-noAdd-glob} neither of the \texttt{ifelsefi} code blocks have received indentation, while in \cref{lst:ifelsefi1-output-indent-rules-global} both code blocks have received a single space of indentation. + + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile{demonstrations/ifelsefi1-noAdd-glob.tex}{\texttt{ifelsefi1.tex} using \cref{lst:ifelsefi-noAdd-glob}}{lst:ifelsefi1-output-noAdd-glob} + \end{minipage} + \hfill + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile[showspaces=true]{demonstrations/ifelsefi1-indent-rules-global.tex}{\texttt{ifelsefi1.tex} using \cref{lst:ifelsefi-indent-rules-global}}{lst:ifelsefi1-output-indent-rules-global} + \end{minipage} diff --git a/test-cases/documentation/subsubsec-no-add-remaining-code-blocks-mod1.tex b/test-cases/documentation/subsubsec-no-add-remaining-code-blocks-mod1.tex new file mode 100644 index 00000000..4901c594 --- /dev/null +++ b/test-cases/documentation/subsubsec-no-add-remaining-code-blocks-mod1.tex @@ -0,0 +1,88 @@ +% arara: pdflatex: {shell: yes, files: [latexindent]} +\subsubsection{The remaining code blocks} + Referencing the different types of code blocks in \vref{tab:code-blocks}, we have a few code blocks yet to cover; these are very similar to the \texttt{commands} code block type covered comprehensively in \vref{subsubsec:commands-arguments}, but a small discussion defining these remaining code blocks is necessary. + + \paragraph{\texttt{keyEqualsValuesBracesBrackets}} + \texttt{latexindent.pl} defines this type of code block by the following criteria: \begin{itemize} \item it must immediately follow either \lstinline!{! OR \lstinline![! OR \lstinline!,! with comments and blank lines allowed; + \item then it has a name made up of the characters detailed in \vref{tab:code-blocks}; + \item then an $=$ symbol; + \item then at least one set of curly braces or square brackets (comments and line breaks allowed throughout). + \end{itemize} + + An example is shown in \cref{lst:pgfkeysbefore}, with the default output given in \cref{lst:pgfkeys1:default}. + + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile{demonstrations/pgfkeys1.tex}{\texttt{pgfkeys1.tex}}{lst:pgfkeysbefore} + \end{minipage}% + \hfill + \begin{minipage}{.5\textwidth} + \cmhlistingsfromfile[showtabs=true]{demonstrations/pgfkeys1-default.tex}{\texttt{pgfkeys1.tex} default output}{lst:pgfkeys1:default} + \end{minipage}% + + In \cref{lst:pgfkeys1:default}, note that the maximum indentation is three tabs, and these come from: \begin{itemize} \item the \lstinline!\pgfkeys! command's mandatory argument; + \item the \lstinline!start coordinate/.initial! key's mandatory argument; + \item the \lstinline!start coordinate/.initial! key's body, which is defined as any lines following the name of the key that include its arguments. + This is the part controlled by the \emph{body} field for \texttt{noAdditionalIndent} and friends from \cpageref{sec:noadd-indent-rules}. + \end{itemize} + \paragraph{\texttt{namedGroupingBracesBrackets}} + This type of code block is mostly motivated by tikz-based code; we define this code block as follows: \begin{itemize} \item it must immediately follow either \emph{horizontal space} OR \emph{one or more line breaks} OR \lstinline!{! OR \lstinline![! OR \lstinline!$! OR \lstinline!)! OR \lstinline!(!; + \item the name may contain the characters detailed in \vref{tab:code-blocks}; + \item then at least one set of curly braces or square brackets (comments and line breaks allowed throughout). + \end{itemize} + A simple example is given in \cref{lst:child1}, with default output in \cref{lst:child1:default}. + + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile{demonstrations/child1.tex}{\texttt{child1.tex}}{lst:child1} + \end{minipage}% + \hfill + \begin{minipage}{.5\textwidth} + \cmhlistingsfromfile[showtabs=true]{demonstrations/child1-default.tex}{\texttt{child1.tex} default output}{lst:child1:default} + \end{minipage}% + + In particular, \texttt{latexindent.pl} considers \texttt{child}, \texttt{parent} and \texttt{node} all to be \texttt{namedGroupingBracesBrackets}\footnote{ You may like to verify this by using the \texttt{-tt} option and checking \texttt{indent.log}! + }. + Referencing \cref{lst:child1:default}, note that the maximum indentation is two tabs, and these come from: \begin{itemize} \item the \lstinline!child!'s mandatory argument; + \item the \lstinline!child!'s body, which is defined as any lines following the name of the \texttt{namedGroupingBracesBrackets} that include its arguments. + This is the part controlled by the \emph{body} field for \texttt{noAdditionalIndent} and friends from \cpageref{sec:noadd-indent-rules}. + \end{itemize} + + \paragraph{\texttt{UnNamedGroupingBracesBrackets}} occur in a variety of situations; specifically, we define + this type of code block as satisfying the following criteria: + \begin{itemize} + \item it must immediately follow either \lstinline!{! OR \lstinline![! OR \lstinline!,! OR \lstinline!&! OR \lstinline!)! OR \lstinline!(! + OR \lstinline!$!; + \item then at least one set of curly braces or square brackets (comments and line breaks allowed throughout). + \end{itemize} + + An example is shown in \cref{lst:psforeach1} with default output give in \cref{lst:psforeach:default}. + + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile{demonstrations/psforeach1.tex}{\texttt{psforeach1.tex}}{lst:psforeach1} + \end{minipage}% + \hfill + \begin{minipage}{.5\textwidth} + \cmhlistingsfromfile[showtabs=true]{demonstrations/psforeach1-default.tex}{\texttt{psforeach1.tex} default output}{lst:psforeach:default} + \end{minipage}% + + Referencing \cref{lst:psforeach:default}, there are \emph{three} sets of unnamed braces. + Note also that the maximum value of indentation is three tabs, and these come from: \begin{itemize} \item the \lstinline!\psforeach! command's mandatory argument; + \item the \emph{first} un-named braces mandatory argument; + \item the \emph{first} un-named braces \emph{body}, which we define as any lines following the first opening \lstinline!{! or \lstinline![! that defined the code block. + This is the part controlled by the \emph{body} field for \texttt{noAdditionalIndent} and friends from \cpageref{sec:noadd-indent-rules}. + \end{itemize} + Users wishing to customise the mandatory and/or optional arguments on a \emph{per-name} basis for the \texttt{UnNamedGroupingBracesBrackets} should use \texttt{always-un-named}. + + \paragraph{\texttt{filecontents}} code blocks behave just as \texttt{environments}, except that neither arguments nor items are sought. + +\subsubsection{Summary} + Having considered all of the different types of code blocks, the functions of the fields given in \cref{lst:noAdditionalIndentGlobal,lst:indentRulesGlobal} should now make sense. + + \begin{widepage} + \begin{minipage}{.47\linewidth} + \cmhlistingsfromfile[style=noAdditionalIndentGlobal]*{../defaultSettings.yaml}[before=\centering,yaml-TCB]{\texttt{noAdditionalIndentGlobal}}{lst:noAdditionalIndentGlobal} + \end{minipage}% + \hfill + \begin{minipage}{.47\linewidth} + \cmhlistingsfromfile[style=indentRulesGlobal]*{../defaultSettings.yaml}[before=\centering,yaml-TCB]{\texttt{indentRulesGlobal}}{lst:indentRulesGlobal} + \end{minipage}% + \end{widepage} diff --git a/test-cases/documentation/subsubsec-special-mod1.tex b/test-cases/documentation/subsubsec-special-mod1.tex new file mode 100644 index 00000000..0f1600ec --- /dev/null +++ b/test-cases/documentation/subsubsec-special-mod1.tex @@ -0,0 +1,50 @@ +% arara: pdflatex: {shell: yes, files: [latexindent]} +\subsubsection{\texttt{specialBeginEnd} code blocks} + Let's use the example from \vref{lst:specialbefore} which has default output shown in \vref{lst:specialafter}. + + It is recommended to specify \texttt{noAdditionalIndent} and \texttt{indentRules} in the `scalar' form for these type of code blocks, although the `field' form would work, assuming that \texttt{body} was specified. + Examples are shown in \cref{lst:displayMath-noAdd,lst:displayMath-indent-rules}. + + \begin{minipage}{.49\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/displayMath-noAdd.yaml}[width=.9\linewidth,before=\centering,yaml-TCB]{\texttt{displayMath-noAdd.yaml}}{lst:displayMath-noAdd} + \end{minipage} + \hfill + \begin{minipage}{.49\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/displayMath-indent-rules.yaml}[width=.9\linewidth,before=\centering,yaml-TCB]{\texttt{displayMath-indent-rules.yaml}}{lst:displayMath-indent-rules} + \end{minipage} + + After running the following commands, \begin{commandshell} +latexindent.pl special1.tex -local displayMath-noAdd.yaml +latexindent.pl special1.tex -l displayMath-indent-rules.yaml +\end{commandshell} we receive the respective output given in \cref{lst:special1-output-noAdd,lst:special1-output-indent-rules}; note that in \cref{lst:special1-output-noAdd}, the \texttt{displayMath} code block has \emph{not} received any additional indentation, while in \cref{lst:special1-output-indent-rules}, the \texttt{displayMath} code block has received three tabs worth of indentation. + + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile{demonstrations/special1-noAdd.tex}{\texttt{special1.tex} using \cref{lst:displayMath-noAdd}}{lst:special1-output-noAdd} + \end{minipage} + \hfill + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile[showtabs=true]{demonstrations/special1-indent-rules.tex}{\texttt{special1.tex} using \cref{lst:displayMath-indent-rules}}{lst:special1-output-indent-rules} + \end{minipage} + + We may specify \texttt{noAdditionalIndentGlobal} and \texttt{indentRulesGlobal} as in \cref{lst:special-noAdd-glob,lst:special-indent-rules-global}. + + \begin{minipage}{.49\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/special-noAdd-glob.yaml}[width=.9\linewidth,before=\centering,yaml-TCB]{\texttt{special-noAdd-glob.yaml}}{lst:special-noAdd-glob} + \end{minipage} + \hfill + \begin{minipage}{.49\textwidth} + \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/special-indent-rules-global.yaml}[width=.9\linewidth,before=\centering,yaml-TCB]{\texttt{special-indent-rules-global.yaml}}{lst:special-indent-rules-global} + \end{minipage} + + Upon running the following commands \begin{commandshell} +latexindent.pl special1.tex -local special-noAdd-glob.yaml +latexindent.pl special1.tex -l special-indent-rules-global.yaml +\end{commandshell} we receive the outputs in \cref{lst:special1-output-noAdd-glob,lst:special1-output-indent-rules-global}; notice that in \cref{lst:special1-output-noAdd-glob} neither of the \texttt{special} code blocks have received indentation, while in \cref{lst:special1-output-indent-rules-global} both code blocks have received a single space of indentation. + + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile{demonstrations/special1-noAdd-glob.tex}{\texttt{special1.tex} using \cref{lst:special-noAdd-glob}}{lst:special1-output-noAdd-glob} + \end{minipage} + \hfill + \begin{minipage}{.45\textwidth} + \cmhlistingsfromfile[showspaces=true]{demonstrations/special1-indent-rules-global.tex}{\texttt{special1.tex} using \cref{lst:special-indent-rules-global}}{lst:special1-output-indent-rules-global} + \end{minipage} diff --git a/test-cases/documentation/title-mod1.tex b/test-cases/documentation/title-mod1.tex new file mode 100644 index 00000000..8c723d64 --- /dev/null +++ b/test-cases/documentation/title-mod1.tex @@ -0,0 +1,26 @@ +\title{% + \begin{tcolorbox}[ + width=5.2cm, + boxrule=0pt, + colframe=white!40!black, + colback=white, + rightrule=2pt, + sharp corners, + enhanced, + overlay={\node[anchor=north east,outer sep=2pt] at ([xshift=3cm,yshift=4mm]frame.north east) {\includegraphics[width=3cm]{logo}}; }] + \centering\ttfamily\bfseries latexindent.pl\\[1cm] Version 3.4 + \end{tcolorbox} +} +\author{Chris Hughes \thanks{and contributors! + See \vref{sec:contributors}. + For all communication, please visit \cite{latexindent-home}. + }} +\maketitle +\begin{adjustwidth}{1cm}{1cm} + \small + \texttt{latexindent.pl} is a \texttt{Perl} script that indents \texttt{.tex} (and other) files according to an indentation scheme that the user can modify to suit their taste. + Environments, including those with alignment delimiters (such as \texttt{tabular}), and commands, including those that can split braces and brackets across lines, are \emph{usually} handled correctly by the script. + Options for \texttt{verbatim}-like environments and commands, together with indentation after headings (such as \lstinline!chapter!, \lstinline!section!, etc) are also available. + The script also has the ability to modifiy line breaks, and add comment symbols. + All user options are customisable via the switches in the YAML interface; you can find a quick start guide in \vref{sec:quickstart}. +\end{adjustwidth} diff --git a/test-cases/items/bug.yaml b/test-cases/items/bug.yaml new file mode 100644 index 00000000..16b9af34 --- /dev/null +++ b/test-cases/items/bug.yaml @@ -0,0 +1,3 @@ +modifyLineBreaks: + items: + ItemStartsOnOwnLine: 1 diff --git a/test-cases/items/bug1-mod0.tex b/test-cases/items/bug1-mod0.tex new file mode 100644 index 00000000..d816b091 --- /dev/null +++ b/test-cases/items/bug1-mod0.tex @@ -0,0 +1,3 @@ +\begin{enumerate}[anything] + \item one +\end{enumerate} diff --git a/test-cases/items/bug1.tex b/test-cases/items/bug1.tex new file mode 100644 index 00000000..d816b091 --- /dev/null +++ b/test-cases/items/bug1.tex @@ -0,0 +1,3 @@ +\begin{enumerate}[anything] + \item one +\end{enumerate} diff --git a/test-cases/items/items-test-cases.sh b/test-cases/items/items-test-cases.sh index 0fec123c..ebb69bb1 100755 --- a/test-cases/items/items-test-cases.sh +++ b/test-cases/items/items-test-cases.sh @@ -75,5 +75,7 @@ latexindent.pl -s items12.tex -m -l=../opt-args/opt-args-remove-all.yaml,../envi latexindent.pl -s items12.tex -o=items12-Global.tex -l=../environments/env-all-on.yaml,noAdditionalIndentGlobal.yaml,resetItem.yaml # indentRules latexindent.pl -s items12.tex -o=items12-indent-rules-Global.tex -l=../environments/env-all-on.yaml,indentRulesGlobal.yaml,resetItem.yaml +# poly-switch bug reported at https://github.com/cmhughes/latexindent.pl/issues/94 +latexindent.pl -s -m bug1.tex -o=+-mod0 -l=bug.yaml [[ $noisyMode == 1 ]] && makenoise git status diff --git a/test-cases/maxLineChars/bug1-mod0.tex b/test-cases/maxLineChars/bug1-mod0.tex new file mode 100644 index 00000000..610010d7 --- /dev/null +++ b/test-cases/maxLineChars/bug1-mod0.tex @@ -0,0 +1,16 @@ +s +a +fi +le +%commantasdas +\m +yc +om +ma +nd + {s + om + et + hi + ng + }% more coment diff --git a/test-cases/maxLineChars/bug1.tex b/test-cases/maxLineChars/bug1.tex new file mode 100644 index 00000000..3f9b75eb --- /dev/null +++ b/test-cases/maxLineChars/bug1.tex @@ -0,0 +1,2 @@ +s a file%commantasdas +\mycommand{something}% more coment diff --git a/test-cases/maxLineChars/longlines-test-cases.sh b/test-cases/maxLineChars/longlines-test-cases.sh index 512cf305..634d474f 100755 --- a/test-cases/maxLineChars/longlines-test-cases.sh +++ b/test-cases/maxLineChars/longlines-test-cases.sh @@ -87,6 +87,7 @@ latexindent.pl -m -s jowens-short-multi-line-stop.tex -l removeParaLineBreaks0.y latexindent.pl -m -s jowens-follow-ups.tex -l removeParaLineBreaks0.yaml -o jowens-follow-ups-mod0.tex latexindent.pl -m -s jowens-follow-ups.tex -l removeParaLineBreaks0.yaml,description.yaml -o jowens-follow-ups-mod1.tex latexindent.pl -m -s jowens-follow-ups.tex -l removeParaLineBreaks0.yaml,description.yaml,stopParaAtComments.yaml -o jowens-follow-ups-mod2.tex - +# bug reported at https://github.com/cmhughes/latexindent.pl/issues/90 +latexindent.pl -m -s bug1 -o=+-mod0 -y="modifyLineBreaks:textWrapOptions:columns:3" git status [[ $noisyMode == 1 ]] && makenoise diff --git a/test-cases/oneSentencePerLine/alt-full-stop.yaml b/test-cases/oneSentencePerLine/alt-full-stop.yaml new file mode 100644 index 00000000..d1d68073 --- /dev/null +++ b/test-cases/oneSentencePerLine/alt-full-stop.yaml @@ -0,0 +1,6 @@ +modifyLineBreaks: + oneSentencePerLine: + sentencesEndWith: + basicFullStop: 0 + betterFullStop: 0 + other: "\.(?!(?:[a-z]|\}))" diff --git a/test-cases/oneSentencePerLine/basic-full-stop.yaml b/test-cases/oneSentencePerLine/basic-full-stop.yaml new file mode 100644 index 00000000..683e6a28 --- /dev/null +++ b/test-cases/oneSentencePerLine/basic-full-stop.yaml @@ -0,0 +1,6 @@ +modifyLineBreaks: + oneSentencePerLine: + sentencesEndWith: + basicFullStop: 1 + betterFullStop: 0 + other: 0 diff --git a/test-cases/oneSentencePerLine/item.yaml b/test-cases/oneSentencePerLine/item.yaml new file mode 100644 index 00000000..8f5647ea --- /dev/null +++ b/test-cases/oneSentencePerLine/item.yaml @@ -0,0 +1,4 @@ +modifyLineBreaks: + oneSentencePerLine: + sentencesFollow: + other: '\\item' diff --git a/test-cases/oneSentencePerLine/manipulateSentences.yaml b/test-cases/oneSentencePerLine/manipulateSentences.yaml new file mode 100644 index 00000000..1b5cc532 --- /dev/null +++ b/test-cases/oneSentencePerLine/manipulateSentences.yaml @@ -0,0 +1,3 @@ +modifyLineBreaks: + oneSentencePerLine: + manipulateSentences: 1 diff --git a/test-cases/oneSentencePerLine/mlep-mod0.tex b/test-cases/oneSentencePerLine/mlep-mod0.tex new file mode 100644 index 00000000..c12281f5 --- /dev/null +++ b/test-cases/oneSentencePerLine/mlep-mod0.tex @@ -0,0 +1,6 @@ +This is an example (i.e. a test). +The unit is $\rm kg.m^{-2}.s^{-1}$. +Values goes from 0.02 to 0.74 Pa. +Here some space needed \hspace{0.5cm}. +The value is $\lambda=3.67$. +The URL is \url{www.scilab.org}. diff --git a/test-cases/oneSentencePerLine/mlep-mod1.tex b/test-cases/oneSentencePerLine/mlep-mod1.tex new file mode 100644 index 00000000..8740f467 --- /dev/null +++ b/test-cases/oneSentencePerLine/mlep-mod1.tex @@ -0,0 +1,12 @@ +This is an example (i. +e. a test). +The unit is $\rm kg. + m^{-2}.s^{-1}$. +Values goes from 0. +02 to 0.74 Pa. +Here some space needed \hspace{0. + 5cm}. +The value is $\lambda=3. + 67$. +The URL is \url{www. + scilab.org}. diff --git a/test-cases/oneSentencePerLine/mlep.tex b/test-cases/oneSentencePerLine/mlep.tex new file mode 100644 index 00000000..ed91ae0a --- /dev/null +++ b/test-cases/oneSentencePerLine/mlep.tex @@ -0,0 +1 @@ +This is an example (i.e. a test). The unit is $\rm kg.m^{-2}.s^{-1}$. Values goes from 0.02 to 0.74 Pa. Here some space needed \hspace{0.5cm}. The value is $\lambda=3.67$. The URL is \url{www.scilab.org}. diff --git a/test-cases/oneSentencePerLine/mlep2-mod0.tex b/test-cases/oneSentencePerLine/mlep2-mod0.tex new file mode 100644 index 00000000..ed075b28 --- /dev/null +++ b/test-cases/oneSentencePerLine/mlep2-mod0.tex @@ -0,0 +1,27 @@ +The names (Smith, Doe, etc.) are inherited. + +Two items are used: \begin{itemize} \item Item 1. + \item Item 2. +\end{itemize} + +The energy is defined as \begin{equation} E=m c^2 \end{equation} where m is the mass. + +\begin{table}[htbp] + \caption{\label{tab1} + Here is the legend. + } + \begin{tabular}{cc} + 1 & 1 \\ + \end{tabular} +\end{table} + +This is a sentence. + +\begin{table}[htbp] + \caption{\label{tab1} + Here is the legend. + } + \begin{tabular}{cc} + 1 & 1 \\ + \end{tabular} +\end{table} diff --git a/test-cases/oneSentencePerLine/mlep2-mod1.tex b/test-cases/oneSentencePerLine/mlep2-mod1.tex new file mode 100644 index 00000000..8bffc885 --- /dev/null +++ b/test-cases/oneSentencePerLine/mlep2-mod1.tex @@ -0,0 +1,33 @@ +The names (Smith, Doe, etc.) are inherited. + +Two items are used: +\begin{itemize} + \item Item 1. + \item Item 2. +\end{itemize} + +The energy is defined as +\begin{equation} + E=m c^2 +\end{equation} +where m is the mass. + +\begin{table}[htbp] + \caption{\label{tab1} + Here is the legend. + } + \begin{tabular}{cc} + 1 & 1 \\ + \end{tabular} +\end{table} + +This is a sentence. + +\begin{table}[htbp] + \caption{\label{tab1} + Here is the legend. + } + \begin{tabular}{cc} + 1 & 1 \\ + \end{tabular} +\end{table} diff --git a/test-cases/oneSentencePerLine/mlep2-mod2.tex b/test-cases/oneSentencePerLine/mlep2-mod2.tex new file mode 100644 index 00000000..8bffc885 --- /dev/null +++ b/test-cases/oneSentencePerLine/mlep2-mod2.tex @@ -0,0 +1,33 @@ +The names (Smith, Doe, etc.) are inherited. + +Two items are used: +\begin{itemize} + \item Item 1. + \item Item 2. +\end{itemize} + +The energy is defined as +\begin{equation} + E=m c^2 +\end{equation} +where m is the mass. + +\begin{table}[htbp] + \caption{\label{tab1} + Here is the legend. + } + \begin{tabular}{cc} + 1 & 1 \\ + \end{tabular} +\end{table} + +This is a sentence. + +\begin{table}[htbp] + \caption{\label{tab1} + Here is the legend. + } + \begin{tabular}{cc} + 1 & 1 \\ + \end{tabular} +\end{table} diff --git a/test-cases/oneSentencePerLine/mlep2.tex b/test-cases/oneSentencePerLine/mlep2.tex new file mode 100644 index 00000000..92d6c1fb --- /dev/null +++ b/test-cases/oneSentencePerLine/mlep2.tex @@ -0,0 +1,29 @@ +The names (Smith, Doe, etc.) are inherited. + +Two items are used: +\begin{itemize} + \item Item 1. + \item Item 2. +\end{itemize} + +The energy is defined as +\begin{equation} + E=m c^2 +\end{equation} +where m is the mass. + +\begin{table}[htbp] + \caption{\label{tab1} Here is the legend.} + \begin{tabular}{cc} + 1 & 1 \\ + \end{tabular} +\end{table} + +This is a sentence. + +\begin{table}[htbp] + \caption{\label{tab1} Here is the legend.} + \begin{tabular}{cc} + 1 & 1 \\ + \end{tabular} +\end{table} diff --git a/test-cases/oneSentencePerLine/mlep2.yaml b/test-cases/oneSentencePerLine/mlep2.yaml new file mode 100644 index 00000000..141c8eb0 --- /dev/null +++ b/test-cases/oneSentencePerLine/mlep2.yaml @@ -0,0 +1,6 @@ +modifyLineBreaks: + environments: + BeginStartsOnOwnLine: 1 + BodyStartsOnOwnLine: 1 + EndStartsOnOwnLine: 1 + EndFinishesWithLineBreak: 1 diff --git a/test-cases/oneSentencePerLine/more-code-blocks.tex b/test-cases/oneSentencePerLine/more-code-blocks.tex new file mode 100644 index 00000000..f8bced08 --- /dev/null +++ b/test-cases/oneSentencePerLine/more-code-blocks.tex @@ -0,0 +1,36 @@ +\section*{Executive Summary} +Sonifications are non-verbal representation of plots or graphs. +This report details the results of an eSTEeM-funded project +to investigate the efficacy of sonifications when presented to +participants in study-like activities. We are grateful to eSTEeM +for their support and funding throughout the project. + +\tableofcontents +\section{Introduction} +The depiction of numerical data using graphs and charts play a vital part in many STEM modules. As Tufte says in a key text about the design of plots and charts ``at their best graphics are instruments for reasoning about quantitative measurement'' \cite{Tufte1983}. In this report we will focus on static images, such as graphs and plots in printed materials. Dynamic images in which the user can change +features of the diagram or graph are not considered. In order to meet the OU's mission of being open to [all] people, such plots and graphs need to be accessible to \emph{all} students, as some students may otherwise be disadvantaged in their study. + +The Equality Act 2010 \cite{ehrcequalityact} requires universities to avoid discrimination against people with protected characteristics, +including disability, and to do so by making `reasonable adjustments'. The Equality and Human Rights Commission offers guidance +for Higher Education providers \cite{ehrcprovidersguidance}. The Act created the Public Sector Equality Duty \cite{ehrcpublicsector}, which +requires universities to promote equality of opportunity by removing disadvantage and meet the needs of protected groups. +In the context of The Open University, this means that the authors of module materials should ensure that plots and charts (or alternate versions of them) are accessible to all students with visual impairments, including those students with no vision at all. + +Individuals who are blind have often had limited access to mathematics and science \cite{advisorycommission}, +especially in distance learning courses \cite{educause}; in part this is because of the highly visual nature of the representations of numerical relationships. Methods commonly used to accommodate learners who are blind or have low vision include: use of sighted assistants who can describe graphics verbally; provision of text-based descriptions of graphics that can be read with text-to-speech applications (for example JAWS \cite{jaws}, Dolphin \cite{dolphin}); accessed as Braille, either as hard copy or via refreshable display, or through provision of tactile graphics for visual representations. + +Desirable features of an accessible graph include the following \cite{Summers2012}: +\begin{itemize} + \item Perceptual precision: the representation allows the user to interpret the plot with an appropriate amount of detail. + \item First-hand access: the representation allows the user to directly interpret the data and is not reliant on subject interpretation by others (bias). + \item Works on affordable, mainstream hardware. + \item Born-accessible: the creator of the plot would not have to put extra effort into creating the accessible version. +\end{itemize} + +\begin{figure}[!htb] + \centering + \figureDescription{Screenshot of participant S7 interacting with the ferris wheel example.} + \includegraphics[width=.5\textwidth]{p7-ferris-wheel} + \caption{Visualisation of the sonification from S7.} + \label{fig:partipants-ferris-wheel} +\end{figure} diff --git a/test-cases/oneSentencePerLine/more-code-blocksmod0.tex b/test-cases/oneSentencePerLine/more-code-blocksmod0.tex new file mode 100644 index 00000000..f6fd4e5c --- /dev/null +++ b/test-cases/oneSentencePerLine/more-code-blocksmod0.tex @@ -0,0 +1,34 @@ +\section*{Executive Summary} +Sonifications are non-verbal representation of plots or graphs. +This report details the results of an eSTEeM-funded project to investigate the efficacy of sonifications when presented to participants in study-like activities. +We are grateful to eSTEeM for their support and funding throughout the project. + +\tableofcontents +\section{Introduction} +The depiction of numerical data using graphs and charts play a vital part in many STEM modules. +As Tufte says in a key text about the design of plots and charts ``at their best graphics are instruments for reasoning about quantitative measurement'' \cite{Tufte1983}. +In this report we will focus on static images, such as graphs and plots in printed materials. +Dynamic images in which the user can change features of the diagram or graph are not considered. +In order to meet the OU's mission of being open to [all] people, such plots and graphs need to be accessible to \emph{all} students, as some students may otherwise be disadvantaged in their study. + +The Equality Act 2010 \cite{ehrcequalityact} requires universities to avoid discrimination against people with protected characteristics, including disability, and to do so by making `reasonable adjustments'. +The Equality and Human Rights Commission offers guidance for Higher Education providers \cite{ehrcprovidersguidance}. +The Act created the Public Sector Equality Duty \cite{ehrcpublicsector}, which requires universities to promote equality of opportunity by removing disadvantage and meet the needs of protected groups. +In the context of The Open University, this means that the authors of module materials should ensure that plots and charts (or alternate versions of them) are accessible to all students with visual impairments, including those students with no vision at all. + +Individuals who are blind have often had limited access to mathematics and science \cite{advisorycommission}, especially in distance learning courses \cite{educause}; in part this is because of the highly visual nature of the representations of numerical relationships. +Methods commonly used to accommodate learners who are blind or have low vision include: use of sighted assistants who can describe graphics verbally; provision of text-based descriptions of graphics that can be read with text-to-speech applications (for example JAWS \cite{jaws}, Dolphin \cite{dolphin}); accessed as Braille, either as hard copy or via refreshable display, or through provision of tactile graphics for visual representations. + +Desirable features of an accessible graph include the following \cite{Summers2012}: \begin{itemize} \item Perceptual precision: the representation allows the user to interpret the plot with an appropriate amount of detail. + \item First-hand access: the representation allows the user to directly interpret the data and is not reliant on subject interpretation by others (bias). + \item Works on affordable, mainstream hardware. + \item Born-accessible: the creator of the plot would not have to put extra effort into creating the accessible version. +\end{itemize} + +\begin{figure}[!htb] + \centering + \figureDescription{Screenshot of participant S7 interacting with the ferris wheel example.} + \includegraphics[width=.5\textwidth]{p7-ferris-wheel} + \caption{Visualisation of the sonification from S7.} + \label{fig:partipants-ferris-wheel} +\end{figure} diff --git a/test-cases/oneSentencePerLine/more-code-blocksmod1.tex b/test-cases/oneSentencePerLine/more-code-blocksmod1.tex new file mode 100644 index 00000000..f753861b --- /dev/null +++ b/test-cases/oneSentencePerLine/more-code-blocksmod1.tex @@ -0,0 +1,37 @@ +\section*{Executive Summary} +Sonifications are non-verbal representation of plots or graphs. +This report details the results of an eSTEeM-funded project to investigate the efficacy of sonifications when presented to participants in study-like activities. +We are grateful to eSTEeM for their support and funding throughout the project. + +\tableofcontents +\section{Introduction} +The depiction of numerical data using graphs and charts play a vital part in many STEM modules. +As Tufte says in a key text about the design of plots and charts ``at their best graphics are instruments for reasoning about quantitative measurement'' \cite{Tufte1983}. +In this report we will focus on static images, such as graphs and plots in printed materials. +Dynamic images in which the user can change features of the diagram or graph are not considered. +In order to meet the OU's mission of being open to [all] people, such plots and graphs need to be accessible to \emph{all} students, as some students may otherwise be disadvantaged in their study. + +The Equality Act 2010 \cite{ehrcequalityact} requires universities to avoid discrimination against people with protected characteristics, including disability, and to do so by making `reasonable adjustments'. +The Equality and Human Rights Commission offers guidance for Higher Education providers \cite{ehrcprovidersguidance}. +The Act created the Public Sector Equality Duty \cite{ehrcpublicsector}, which requires universities to promote equality of opportunity by removing disadvantage and meet the needs of protected groups. +In the context of The Open University, this means that the authors of module materials should ensure that plots and charts (or alternate versions of them) are accessible to all students with visual impairments, including those students with no vision at all. + +Individuals who are blind have often had limited access to mathematics and science \cite{advisorycommission}, especially in distance learning courses \cite{educause}; in part this is because of the highly visual nature of the representations of numerical relationships. +Methods commonly used to accommodate learners who are blind or have low vision include: +use of sighted assistants who can describe graphics verbally; provision of text-based descriptions of graphics that can be read with text-to-speech applications (for example JAWS \cite{jaws}, Dolphin \cite{dolphin}); accessed as Braille, either as hard copy or via refreshable display, or through provision of tactile graphics for visual representations. + +Desirable features of an accessible graph include the following \cite{Summers2012}: +\begin{itemize} + \item Perceptual precision: the representation allows the user to interpret the plot with an appropriate amount of detail. + \item First-hand access: the representation allows the user to directly interpret the data and is not reliant on subject interpretation by others (bias). + \item Works on affordable, mainstream hardware. + \item Born-accessible: the creator of the plot would not have to put extra effort into creating the accessible version. +\end{itemize} + +\begin{figure}[!htb] + \centering + \figureDescription{Screenshot of participant S7 interacting with the ferris wheel example.} + \includegraphics[width=.5\textwidth]{p7-ferris-wheel} + \caption{Visualisation of the sonification from S7.} + \label{fig:partipants-ferris-wheel} +\end{figure} diff --git a/test-cases/oneSentencePerLine/more-code-blocksmod2.tex b/test-cases/oneSentencePerLine/more-code-blocksmod2.tex new file mode 100644 index 00000000..3d7f3b6f --- /dev/null +++ b/test-cases/oneSentencePerLine/more-code-blocksmod2.tex @@ -0,0 +1,44 @@ +\section*{Executive Summary} +Sonifications are non-verbal representation of plots or graphs. +This report details the results of an eSTEeM-funded project to investigate the efficacy of sonifications when presented to participants in study-like activities. +We are grateful to eSTEeM for their support and funding throughout the project. + +\tableofcontents +\section{Introduction} +The depiction of numerical data using graphs and charts play a vital part in many STEM modules. +As Tufte says in a key text about the design of plots and charts ``at their best graphics are instruments for reasoning about quantitative measurement'' \cite{Tufte1983}. +In this report we will focus on static images, such as graphs and plots in printed materials. +Dynamic images in which the user can change features of the diagram or graph are not considered. +In order to meet the OU's mission of being open to [all] people, such plots and graphs need to be accessible to \emph{all} students, as some students may otherwise be disadvantaged in their study. + +The Equality Act 2010 \cite{ehrcequalityact} requires universities to avoid discrimination against people with protected characteristics, including disability, and to do so by making `reasonable adjustments'. +The Equality and Human Rights Commission offers guidance for Higher Education providers \cite{ehrcprovidersguidance}. +The Act created the Public Sector Equality Duty \cite{ehrcpublicsector}, which requires universities to promote equality of opportunity by removing disadvantage and meet the needs of protected groups. +In the context of The Open University, this means that the authors of module materials should ensure that plots and charts (or alternate versions of them) are accessible to all students with visual impairments, including those students with no vision at all. + +Individuals who are blind have often had limited access to mathematics and science \cite{advisorycommission}, especially in distance learning courses \cite{educause}; in part this is because of the highly visual nature of the representations of numerical relationships. +Methods commonly used to accommodate learners who are blind or have low vision include: +use of sighted assistants who can describe graphics verbally; provision of text-based descriptions of graphics that can be read with text-to-speech applications (for example JAWS \cite{jaws}, Dolphin \cite{dolphin}); accessed as Braille, either as hard copy or via refreshable display, or through provision of tactile graphics for visual representations. + +Desirable features of an accessible graph include the following \cite{Summers2012}: +\begin{itemize} + \item + Perceptual precision: + the representation allows the user to interpret the plot with an appropriate amount of detail. + \item + First-hand access: + the representation allows the user to directly interpret the data and is not reliant on subject interpretation by others (bias). + \item + Works on affordable, mainstream hardware. + \item + Born-accessible: + the creator of the plot would not have to put extra effort into creating the accessible version. +\end{itemize} + +\begin{figure}[! + htb] \centering \figureDescription{Screenshot of participant S7 interacting with the ferris wheel example. + } + \includegraphics[width=.5\textwidth]{p7-ferris-wheel} + \caption{Visualisation of the sonification from S7.} + \label{fig:partipants-ferris-wheel} +\end{figure} diff --git a/test-cases/oneSentencePerLine/one-sentence-per-line.sh b/test-cases/oneSentencePerLine/one-sentence-per-line.sh new file mode 100755 index 00000000..39239372 --- /dev/null +++ b/test-cases/oneSentencePerLine/one-sentence-per-line.sh @@ -0,0 +1,75 @@ +#!/bin/bash +loopmax=6 +. ../common.sh + +[[ $silentMode == 0 ]] && set -x + +# two sentences +latexindent.pl -s two-sentences.tex -m -o=+mod0 +latexindent.pl -s two-sentences.tex -m -o=+mod1 -l=manipulateSentences.yaml +# three sentences +latexindent.pl -s three-sentences-trailing-comments.tex -m -o=+mod1 -l=manipulateSentences.yaml +latexindent.pl -s three-sentences-trailing-comments.tex -m -o=+mod2 -l=manipulateSentences.yaml -y="modifyLineBreaks:preserveBlankLines:0" +# six sentences +latexindent.pl -s six-sentences.tex -m -o=+mod1 -l=manipulateSentences.yaml +latexindent.pl -s six-sentences.tex -m -o=+mod2 -l=manipulateSentences.yaml -y="modifyLineBreaks:preserveBlankLines:0" +latexindent.pl -s six-sentences.tex -m -o=+mod3 -l=manipulateSentences.yaml -y="modifyLineBreaks:oneSentencePerLine:sentencesEndWith:exclamationMark:0" +latexindent.pl -s six-sentences.tex -m -o=+mod4 -l=manipulateSentences.yaml -y="modifyLineBreaks:oneSentencePerLine:sentencesEndWith:betterFullStop:0" +latexindent.pl -s six-sentences.tex -m -o=+mod5 -l=manipulateSentences.yaml -y="modifyLineBreaks:oneSentencePerLine:sentencesEndWith:questionMark:0" +# six sentences, and blank lines +latexindent.pl -s six-sentences-mult-blank.tex -m -o=+mod0 -l=manipulateSentences.yaml +latexindent.pl -s six-sentences-mult-blank.tex -m -o=+mod1 -l=manipulateSentences.yaml -y="modifyLineBreaks:preserveBlankLines:0;condenseMultipleBlankLinesInto:0" +latexindent.pl -s six-sentences-mult-blank.tex -m -o=+mod2 -l=manipulateSentences.yaml -y="modifyLineBreaks:oneSentencePerLine:sentencesFollow:blankLine:0" +latexindent.pl -s six-sentences-mult-blank.tex -m -o=+mod3 -l=manipulateSentences.yaml -y="modifyLineBreaks:oneSentencePerLine:sentencesFollow:blankLine: 0;fullStop:0" +latexindent.pl -s six-sentences-mult-blank.tex -m -o=+mod4 -l=manipulateSentences.yaml -y="modifyLineBreaks:oneSentencePerLine:sentencesFollow:blankLine: 0;exclamationMark:0" +latexindent.pl -s six-sentences-mult-blank.tex -m -o=+mod5 -l=manipulateSentences.yaml -y="modifyLineBreaks:oneSentencePerLine:sentencesFollow:blankLine: 0;questionMark:0" +latexindent.pl -s six-sentences-mult-blank.tex -m -o=+mod6 -l=manipulateSentences.yaml -y="modifyLineBreaks:oneSentencePerLine:removeSentenceLineBreaks:0" +# other punctuation +latexindent.pl -s other-punctuation.tex -m -o=+mod0 -l=manipulateSentences.yaml +latexindent.pl -s other-punctuation.tex -m -o=+mod1 -l=manipulateSentences.yaml,sentences-start-with-lower-case.yaml -y="modifyLineBreaks:oneSentencePerLine:sentencesEndWith:other:\;" +latexindent.pl -s other-punctuation.tex -m -o=+mod2 -l=manipulateSentences.yaml,sentences-start-with-lower-case.yaml -y="modifyLineBreaks:oneSentencePerLine:sentencesEndWith:other:\;|\:" +latexindent.pl -s other-punctuation.tex -m -o=+mod3 -l=manipulateSentences.yaml,sentences-start-with-lower-case.yaml -y='modifyLineBreaks:oneSentencePerLine:sentencesEndWith:other:\;|\:|"' +# sentences across blank lines, note the difference between the following two +latexindent.pl -s sentences-across-blank-lines.tex -m -o=+mod0 -l=manipulateSentences.yaml +latexindent.pl -s sentences-across-blank-lines.tex -m -o=+mod1 -l=manipulateSentences.yaml -y="modifyLineBreaks:preserveBlankLines:0" +# sentences across code blocks +latexindent.pl -s sentences-across-blocks.tex -m -o=+mod0 -l=manipulateSentences.yaml +# tex book snippet +latexindent.pl -s texbook-snippet.tex -m -o=+mod1 -l=manipulateSentences.yaml +latexindent.pl -s texbook-snippet.tex -m -o=+mod2 -l=manipulateSentences.yaml,sentences-start-with-lower-case.yaml -y="modifyLineBreaks:oneSentencePerLine:sentencesEndWith:other:\;|\,|\:" +latexindent.pl -s texbook-snippet.tex -m -o=+mod3 -l=manipulateSentences.yaml -y="modifyLineBreaks:oneSentencePerLine:sentencesFollow:commentOnPreviousLine:0" +# verbatim block +latexindent.pl -s verbatim-test.tex -m -o=+mod0 -l=manipulateSentences.yaml +# more code blocks +latexindent.pl -s more-code-blocks.tex -m -o=+mod0 -l=manipulateSentences.yaml +latexindent.pl -s more-code-blocks.tex -m -o=+mod1 -l=manipulateSentences.yaml -y='modifyLineBreaks:oneSentencePerLine:sentencesEndWith:other:\:' +latexindent.pl -s more-code-blocks.tex -m -o=+mod2 -l=manipulateSentences.yaml,sentences-start-with-lower-case.yaml,item.yaml -y='modifyLineBreaks:oneSentencePerLine:sentencesEndWith:other:\:' +# webwork guide +latexindent.pl -s webwork-guide -m -o=+mod0 -l=manipulateSentences.yaml,basic-full-stop.yaml +latexindent.pl -s webwork-guide -m -o=+mod1 -l=manipulateSentences.yaml,alt-full-stop +# trailing comments +latexindent.pl -s trailing-comments -m -o=+mod0 -l=manipulateSentences.yaml +latexindent.pl -s trailing-comments -m -o=+mod1 -l=manipulateSentences.yaml -y="modifyLineBreaks:oneSentencePerLine:removeSentenceLineBreaks:0" +# sentences beginning with 'other' +latexindent.pl -s other-begins -m -o=+mod0 -l=manipulateSentences.yaml +latexindent.pl -s other-begins -m -o=+mod1 -l=manipulateSentences.yaml,other-begins.yaml +# from the feature request (https://github.com/cmhughes/latexindent.pl/issues/81) +latexindent.pl -s -m mlep -o=+-mod0 -l=manipulateSentences.yaml +latexindent.pl -s -m mlep -o=+-mod1 -l=manipulateSentences.yaml,basic-full-stop.yaml +latexindent.pl -s -m mlep2 -o=+-mod0 -l=manipulateSentences.yaml +latexindent.pl -s -m mlep2 -o=+-mod1 -l=manipulateSentences.yaml,mlep2.yaml +latexindent.pl -s -m mlep2 -o=+-mod2 -l=manipulateSentences.yaml -y="modifyLineBreaks:oneSentencePerLine:removeSentenceLineBreaks:0" +# pcc program review test cases (https://github.com/PCCMathSAC/PCCMathProgramReview2014) +for (( i=$loopmin ; i <= $loopmax ; i++ )) +do + [[ $showCounter == 1 ]] && echo $i of $loopmax + [[ $silentMode == 0 ]] && set -x + latexindent.pl -s pcc-program-review$i.tex -m -o=+-mod1 -l=manipulateSentences.yaml,basic-full-stop.yaml + latexindent.pl -s pcc-program-review$i.tex -m -o=+-mod2 -l=manipulateSentences.yaml,item,pcc-program-review + [[ $silentMode == 0 ]] && set +x +done + +[[ $silentMode == 0 ]] && set -x + +[[ $noisyMode == 1 ]] && makenoise +git status diff --git a/test-cases/oneSentencePerLine/other-begins.tex b/test-cases/oneSentencePerLine/other-begins.tex new file mode 100644 index 00000000..dac1f7c3 --- /dev/null +++ b/test-cases/oneSentencePerLine/other-begins.tex @@ -0,0 +1,11 @@ +This is the first +sentence. 7 is the second +sentence. This is the +third sentence. + +This is the fourth +sentence! This is the fifth sentence? This is the +sixth sentence. $a$ is often +referred to as +an integer. furthermore +we have that. diff --git a/test-cases/oneSentencePerLine/other-begins.yaml b/test-cases/oneSentencePerLine/other-begins.yaml new file mode 100644 index 00000000..72c1da39 --- /dev/null +++ b/test-cases/oneSentencePerLine/other-begins.yaml @@ -0,0 +1,6 @@ +modifyLineBreaks: + oneSentencePerLine: + sentencesBeginWith: + A-Z: 1 + a-z: 0 + other: "[0-9]|\$" diff --git a/test-cases/oneSentencePerLine/other-beginsmod0.tex b/test-cases/oneSentencePerLine/other-beginsmod0.tex new file mode 100644 index 00000000..cc067be2 --- /dev/null +++ b/test-cases/oneSentencePerLine/other-beginsmod0.tex @@ -0,0 +1,12 @@ +This is the first sentence. +7 is the second +sentence. +This is the third sentence. + +This is the fourth sentence! +This is the fifth sentence? +This is the sixth sentence. +$a$ is often +referred to as +an integer. furthermore +we have that. diff --git a/test-cases/oneSentencePerLine/other-beginsmod1.tex b/test-cases/oneSentencePerLine/other-beginsmod1.tex new file mode 100644 index 00000000..a7896493 --- /dev/null +++ b/test-cases/oneSentencePerLine/other-beginsmod1.tex @@ -0,0 +1,10 @@ +This is the first sentence. +7 is the second sentence. +This is the third sentence. + +This is the fourth sentence! +This is the fifth sentence? +This is the sixth sentence. +$a$ is often referred to as an integer. +furthermore +we have that. diff --git a/test-cases/oneSentencePerLine/other-punctuation.tex b/test-cases/oneSentencePerLine/other-punctuation.tex new file mode 100644 index 00000000..869d74ee --- /dev/null +++ b/test-cases/oneSentencePerLine/other-punctuation.tex @@ -0,0 +1,10 @@ +This is the first +sentence; this is the second sentence: this is the +third sentence. + +This is the fourth +sentence! This is the fifth sentence? This is the +sixth sentence. + +This is the fourth +sentence" This is the fifth sentence? diff --git a/test-cases/oneSentencePerLine/other-punctuationmod0.tex b/test-cases/oneSentencePerLine/other-punctuationmod0.tex new file mode 100644 index 00000000..ea25a976 --- /dev/null +++ b/test-cases/oneSentencePerLine/other-punctuationmod0.tex @@ -0,0 +1,7 @@ +This is the first sentence; this is the second sentence: this is the third sentence. + +This is the fourth sentence! +This is the fifth sentence? +This is the sixth sentence. + +This is the fourth sentence" This is the fifth sentence? diff --git a/test-cases/oneSentencePerLine/other-punctuationmod1.tex b/test-cases/oneSentencePerLine/other-punctuationmod1.tex new file mode 100644 index 00000000..64eeff57 --- /dev/null +++ b/test-cases/oneSentencePerLine/other-punctuationmod1.tex @@ -0,0 +1,8 @@ +This is the first sentence; +this is the second sentence: this is the third sentence. + +This is the fourth sentence! +This is the fifth sentence? +This is the sixth sentence. + +This is the fourth sentence" This is the fifth sentence? diff --git a/test-cases/oneSentencePerLine/other-punctuationmod2.tex b/test-cases/oneSentencePerLine/other-punctuationmod2.tex new file mode 100644 index 00000000..184dd361 --- /dev/null +++ b/test-cases/oneSentencePerLine/other-punctuationmod2.tex @@ -0,0 +1,9 @@ +This is the first sentence; +this is the second sentence: +this is the third sentence. + +This is the fourth sentence! +This is the fifth sentence? +This is the sixth sentence. + +This is the fourth sentence" This is the fifth sentence? diff --git a/test-cases/oneSentencePerLine/other-punctuationmod3.tex b/test-cases/oneSentencePerLine/other-punctuationmod3.tex new file mode 100644 index 00000000..b05fd925 --- /dev/null +++ b/test-cases/oneSentencePerLine/other-punctuationmod3.tex @@ -0,0 +1,10 @@ +This is the first sentence; +this is the second sentence: +this is the third sentence. + +This is the fourth sentence! +This is the fifth sentence? +This is the sixth sentence. + +This is the fourth sentence" +This is the fifth sentence? diff --git a/test-cases/oneSentencePerLine/pcc-program-review.yaml b/test-cases/oneSentencePerLine/pcc-program-review.yaml new file mode 100644 index 00000000..b51353b7 --- /dev/null +++ b/test-cases/oneSentencePerLine/pcc-program-review.yaml @@ -0,0 +1,19 @@ +modifyLineBreaks: + oneSentencePerLine: + sentencesBeginWith: + other: "\\\\Cref|\([A-Z]" + sentencesEndWith: + basicFullStop: 0 + betterFullStop: 0 + other: "(?:\.\)(?!\h*[a-z]))|(?<!(?:(?:e\.g)))\.(?!(?:[a-z]|[A-Z]|\-|\,|\}|[0-9]))" + items: + ItemStartsOnOwnLine: 1 + ItemFinishesWithLineBreak: -1 + environments: + BeginStartsOnOwnLine: 1 + BodyStartsOnOwnLine: 1 + EndStartsOnOwnLine: 1 + EndFinishesWithLineBreak: 1 +lookForAlignDelims: + tabular: + multiColumnGrouping: 1 diff --git a/test-cases/oneSentencePerLine/pcc-program-review1-mod1.tex b/test-cases/oneSentencePerLine/pcc-program-review1-mod1.tex new file mode 100644 index 00000000..4b67fe91 --- /dev/null +++ b/test-cases/oneSentencePerLine/pcc-program-review1-mod1.tex @@ -0,0 +1,414 @@ +% arara: pdflatex: {files: [MathSACpr2014]} +% !arara: indent: {overwrite: yes} +\chapter{Facilities and Support} +\begin{flushright} + \includegraphics[width=8cm]{xkcd-806-tech_support-punchline}\\ + \url{http://xkcd.com} +\end{flushright} +\section[Space, technology, and equipment]{Describe how classroom space, classroom technology, laboratory space + and equipment impact student success.} + +Over the past few years, efforts by the college to create classrooms containing the same basic equipment has helped tremendously with consistency issues. +The nearly universal presence of classroom podiums with attendant Audio Visual (AV) devices is considerably useful. +For example, many instructors use computer-based calculator emulators when instructing their students on calculator use---this allows explicit keystroking examples to be demonstrated that were not possible before the podiums appeared; the document cameras found in most classrooms are also used by most mathematics instructors. +Having an instructor computer with internet access has been a great help as instructors have access to a wide variety of tools to engage students, as well as a source for quick answers when unusual questions arise. + +Several classrooms on the Sylvania campus have Starboards or Smart Boards integrated with their AV systems. +Many mathematics instructors use these tools as their primary presentation vehicles; documents can be preloaded into the software and the screens allow instructors to write their work directly onto the document. +Among other things, this makes it easy to save the work into pdf files that can be accessed by students outside of class. +This equipment is not used as much on the other campuses, but there are instructors on other campuses that say they would use them if they were widely available on their campus. + +A few instructors have begun creating lessons with LiveScribe technology. +The technology allows the instructor to make an audio/visual record of their lecture without a computer or third person recording device; instructors can post a `live copy' of their actual class lecture online. +The students do not simply see a static copy of the notes that were written; the students see the notes emerge as they were being written and they hear the words that were spoken while they were written. +The use of LiveScribe technology is strongly supported by Disability Services, and for that reason alone continued experimentation with its use is strongly encouraged. + +Despite all of the improvements that have been made in classrooms over the past few years, there still are some serious issues. + +Rooms are assigned randomly, which often leads to mathematics classes being scheduled in rooms that are not appropriate for a math class. +For example, scheduling a math class in a room with individual student desks creates a lot of problems; many instructors have students take notes, refer to their text, and use their calculator all at the same time and there simply is not enough room on the individual desktops to keep all of that material in place. +More significantly, this furniture is especially ill-suited for group work. +Not only does the movement of desks and sharing of work exacerbate the materials issue (materials frequently falling off the desks), students simply cannot share their work in the efficient way that work can be shared when they are gathered about tables. +It would be helpful if all non-computer-based math classes could be scheduled in rooms with tables. + +Another problem relates to an inadequate number of computerized classrooms and insufficient space in many of the existing computerized classroom; both of these shortages have greatly increased due to Bond-related construction. +Several sections of MTH 243 and MTH 244 (statistics courses), which are normally taught in computerized classrooms, \emph{have} been scheduled in regular classrooms. +Many of the statistics courses that were scheduled in computerized classrooms have been scheduled in rooms that seat only 28, 24, or even 20 students. +When possible, we generally limit our class capacities at 34 or 35. +Needless to say, running multiple sections of classes in rooms well below those capacities creates many problems. +This is especially problematic for student success, as it hinders students' ability to register due to undersized classrooms. + +Finally, the computerized classrooms could be configured in such a way that maximizes potential for meaningful student engagement and minimizes potential for students to get off course due to internet access. +We believe that all computerized classrooms need to come equipped with software that allows the instructor control of the student computers such as LanSchool Classroom Management Software. +The need for this technology is dire; it will reduce or eliminate students being off task when using computers, and it will allow another avenue to facilitate instruction as the instructor will be able to `see' any student computer and `interact' with any student computer. +It can also be used to solicit student feedback in an anonymous manner. +The gathering of anonymous feedback can frequently provide a better gauge of the general level of understanding than activities such as the traditional showing of hands. + +\recommendation[Scheduling]{All mathematics classes should be scheduled in rooms that are either + computerized (upon request) or have multi-person tables (as opposed to + individual desks).} + +\recommendation[Scheduling, Deans of Instruction, PCC Cabinet]{All computerized classrooms + should have at least 30, if not 34, individual work + stations.} + +\recommendation[Multimedia Services, Deans of Instruction, PCC Cabinet]{An adequate number of classrooms on all campuses should be equipped with + Smartboards so that all instructors who want access to the technology can teach + every one of their classes in rooms equipped with the technology.} + +\recommendation[Multimedia Services, TSS]{The disk image for all computerized classrooms should include software that + allows the podium computer direct access to each student + computer. } + +\section[Library and other outside-the-classroom information + resources]{Describe how students are using the library or other + outside-the-classroom information resources. } +We researched this topic by conducting a stratified sampling method survey of 976 on-campus students and 291 online students; the participants were chosen in a random manner. +We gave scantron surveys to the on-campus students and used SurveyMonkey for the online students. +We found that students are generally knowledgeable about library resources and other outside-the-classroom resources. +The complete survey, together with its results, is given in \vref{app:sec:resourcesurvey}; we have summarized our comments to some of the more interesting questions below. + +\begin{enumerate}[label=Q\arabic*.,font=\bf] + \item Not surprisingly, library resources and other campus-based resources + are used more frequently by our on-campus students than by our online + students. + This could be due to less frequent visits to campus for online students and/or online students already having similar resources available to them via the internet. + \item We found that nearly 70\% of instructors include resource information + in their syllabi. + This figure was consistent regardless of the level of the class (DE/transfer level) or the employment status of the instructor (full/part-time). + + We found that a majority of our instructors are using online resources to connect with students. + Online communication between students and instructors is conducted across many platforms such as instructor websites, Desire2Learn, MyPCC, online graphing applications, and online homework platforms. + + We found that students are using external educational websites such as \href{https://www. + khanacademy.org/}{Khan Academy}, + \href{http://patrickjmt.com/}{PatrickJMT}, + \href{http://www.purplemath.com/}{PurpleMath}, and + \href{http://www.youtube.com/}{YouTube}. + The data suggest online students use these services more than on-campus students. + \item The use of online homework (such as WeBWorK, MyMathLab, MyStatLab, and + ALEKS) has grown significantly over the past few years. + However, the data suggests that significantly more full-time instructors than part-time instructors are directing their students towards these tools (as either a required or optional component of the course). + Additionally, there is a general trend that online homework programs are being used more frequently in online classes than in on-campus classes. + Both of these discrepancies may reflect the need to distribute more information to faculty about these software resources. + \item The Math SAC needs to address whether or not we should be requiring + students to use online resources that impose additional costs upon the + students and, if so, what would constitute a reasonable cost to the + student. + To that end, our survey asked if students would be willing to pay up to \$35 to access online homework and other resources. + We found that online students were more willing to pay an extra fee than those enrolled in on-campus classes. + \setcounter{enumi}{6} + \item The PCC mathematics website offers a wealth of materials that are + frequently accessed by students. + These include course-specific supplements, calculator manuals, and the required Calculus I lab manual; all of these materials were written by PCC mathematics faculty. + Students may print these materials for free from any PCC computer lab. + The website also links to PCC-specific information relevant to mathematics students (such as tutoring resources) as well as outside resources (such as the Texas Instruments website). + \setcounter{enumi}{8} + \item In addition to the previously mentioned resources we also encourage + students to use resources offered at PCC such as on-campus Student Learning + Centers, online tutoring, Collaborate, and/or Elluminate. + A significant number of students registered in on-campus sections are using these resources whereas students enrolled in online sections generally are not. + This is not especially surprising since on-campus students are, well, on campus whereas many online students rarely visit a campus. +\end{enumerate} + +\recommendation[Math SAC]{The majority of our data suggests that students are using a variety of + resources to further their knowledge. + We recommend that instructors continue to educate students about both PCC resources and non-PCC resources. + We need to uniformly encourage students to use resources such as online tutoring, Student Learning Centers, Collaborate, and/or Elluminate; this includes resource citations in each and every course syllabus. +} + +\recommendation[Faculty Department Chairs]{A broader education campaign should be engaged to distribute information to + part-time faculty regarding online homework such as WeBWorK, MyMathLab, + MyStatLab, and ALEKS. } + +\recommendation[Math SAC]{Instructors should consider quality, accessibility and cost to students when + requiring specific curriculum materials. } + +\section[Clerical, technical, administrative and/or tutoring support]{Provide + information on clerical, technical, administrative and/or tutoring support.} + +The Math SAC has a sizable presence on each of PCC's three campuses and at Southeast Center (soon to be a campus in its own right). +Each campus houses a math department within a division of that campus. +The clerical, technical, administrative, and tutoring support systems are best described on location-by-location basis. + +\subsection{Clerical, technical, and administrative support} + +Across the district, our SAC has an excellent and very involved administrative liaison, Dr. +Alyson Lighthart. +We would like to thank her for her countless hours of support in attending our SAC meetings and being available to the SAC Co-Chairs. +She provides us with thoughtful feedback and insightful perspectives that help us gather our thoughts and make sound decisions. + +\subsubsection{Cascade} +The Cascade math department belongs to the Math, Sciences, Health and PE division. +The math department is located on the third floor of the student services building, sharing a floor with the ROOTS office. +The math department also shares space with allied health support staff, medical professions faculty, medical assisting faculty and the Cascade academic intervention specialists (one of whom is also a math part-time faculty). +Part-time math faculty share 11 cubicles, each with a computer. +Our 7 full-time instructors are paired in offices that open up to the part-time cubicles. +We have space in our offices for another full time faculty member as we lost a temporary full-time position at the start of the 2013 academic year. +In Winter 2014, a collective 42 faculty share one high speed Ricoh printer and one copy machine. +Our division offices are located in another building. +We have a dedicated administrative assistant at the front desk who helps students and faculty most days from 8 {\sc a. + m.--5 p.m.} + +\subsubsection{Rock Creek} +The Rock Creek math department is located in the same floor as the division it belongs to (Mathematics, Aviation, and Industrial Technology) and it is shared with Computer Science. +Part-time faculty share fourteen cubicles, each with a computer, located in the same office as full-time instructors, that are used to prepare and meet with students. +The sixty-five plus faculty share two high speed printers that can collate, staple and allow double sided printing, and one high speed scanner. +Currently we have reached space capacity and we will have to re-think the current office configuration in order to add one more full-time faculty member next Fall. +Two years ago the Rock Creek math department added a dedicated administrative assistant, which has helped with scheduling needs, coordinating part-time faculty needs, and providing better service to the students. + +\subsubsection{Southeast} +The clerical and administrative setup at Southeast has changed, as of Winter 2014. +There was a recent restructuring of divisions. +What used to be the Liberal Arts and Sciences Division split into two divisions: the Liberal Arts and CTE Division (which is in the first floor of Scott Hall, Room 103, where the Liberal Arts and Sciences used to be) and the Math and Science Division (which is on the \nth{2} floor of the new Student Commons Building, Room 214). +All of the math and science faculty are now in this new space, including the part-time instructors (everybody was scattered before, so this is a welcome change). + +All of the department chairs have their own offices (with doors), while the rest of the faculty (full-time and part-time) occupy cubicle spaces (approximately 20 cubicles in the space, shared by 4--5 faculty per cubicle). +There are two administrative assistants, one of whom is with the math and science faculty and the other of whom is in charge of the STEM program. +There is also one clerical staff member. + +There is one Ricoh printer in the space, along with a fax machine. +Any and all supplies (markers, erasers, etc. +) are located across the hall in a designated +staff room. + +\subsubsection{Sylvania} +The Sylvania math department belongs to the Math and Industrial Technology division, which is located in the neighboring automotive building. +The math department is currently located in two separate areas of adjacent buildings as of Fall 2013, when the developmental math faculty officially merged with the math department. +This separation will soon be remedied by construction of the new math department area, scheduled to be completed during Spring 2014. +This new location will be next door to the Engineering department, and will share a conference room, copy machine room, and kitchen. +The math department will include two department chair offices, seventeen full-time instructor cubicles, six additional cubicles shared by part-time faculty, and two flex-space rooms. +Each of the cubicles will have a computer, and there will be two shared laser printers plus one color scanner in the department office. + +Our two administrative assistants work an overlapped schedule, which provides dual coverage during the busy midday times and allows the office to remain open to students and visitors for eleven hours. +These assistants do an incredible job serving both student and faculty needs, including: scheduling assistance, interfacing with technical support regarding office and classroom equipment, maintaining supplies inventory, arranging for substitute instructors, securing signatures and processing department paperwork, guiding students to campus resources, and organizing syllabi and schedules from approximately 70 math instructors. + +Our math department has frequent interaction with both Audio-Visual and Technology Solution Services. +Responses by AV to instructor needs in the classroom are extremely prompt--typically within minutes of the notification of a problem. +Since the math department is very technology-oriented, we have many needs that require the assistance of TSS. +Work orders for computer equipment and operational issues that arise on individual faculty computers can take quite a long time to be implemented or to be resolved. +This may be due to the sheer volume of requests that they are processing, but more information during the process, especially notes of any delays, would be welcomed. + +\subsection{Tutoring support} +PCC has a Student Learning Center (SLC) on each campus. +It is a testament to PCC's commitment to student success that the four SLCs exist. +However, discrepancies such as unequal distribution of resources, inconsistency in the number and nature of tutors (including faculty `donating time' to the centers), and disparate hours of operation present challenges to students trying to navigate their way through different centers. + +\recommendation[PCC Cabinet, Deans of Students, Deans of Instructions, Student Learning Centers]{The college should strive for more + consistency with its Student Learning Centers. + We feel that the centers would be an even greater resource if they were more consistent in structure, resource availability, physical space, and faculty support. +} + +Over the last five years the general environment of PCC has been greatly impacted by historically-unmatched enrollment growth (see \vref{fig:sec3:DLenrollments,fig:sec3:F2Fenrollments}). +PCC's four Student Learning Centers have been greatly affected by this (see \vref{app:sec:tutoringhours}). +Most notably, the number of students seeking math tutoring has increased dramatically. +Unfortunately, this increase in student need has not been met by increase in tutors or tutoring resources. +As a result the amount of attention an individual student receives has decreased in a substantive way, leaving students often frustrated and without the help they needed. +Consequently, the numbers of students dropped again as students stopped even trying. +While some of this growth has been (or will be) accommodated by increasing the physical space available for tutoring (i. +e., by the +construction of new facilities at Rock Creek and Southeast), +that is still not enough since personnel resources were not increased at the +same rate and work-study awards have been decreased significantly. +A comprehensive plan needs to be developed and implemented that will ensure each and every student receives high-quality tutoring in a consistent and consistently accessible manner. + +As it now stands, the operation of the SLCs is completely campus driven. +As such, reporting on the current status needs to be done on a campus-by-campus basis. + +\subsubsection{Cascade} +Averaging over non-summer terms from Fall 2008 to Spring 2013, the Cascade SLC has served about 680 math students with 3900 individual visits and 8 hours per student per term. +(See \vref{app:tut:tab:SLC} for a full accounting.) + +The Cascade SLC has increased its operating hours in response to student demand. +Statistics tutoring is now offered at most times and the introduction of online homework has led to `Hybrid Tutoring', where students receive tutoring while working on their online homework. + +At the Cascade Campus, all full-time mathematics instructors and many part-time mathematics instructors volunteer 1--4 hours per week in the SLC to help with student demand. +To help ensure usage throughout the SLC's operational hours, instructors are notified by email of slow-traffic times; this allows the instructors to direct students who need extra help to take advantage of those times. +Other communications such as announcements, ads, and newsletters are sent out regularly. + +Full-time faculty have constructed a `First week lecture series' that they conduct on the first Friday of every term (except summer). +It is designed to review basic skills from MTH 20 through MTH 111. +It is run in 50-minute segments throughout the day with a 10-minute break between each segment. +The first offering of this series began in Winter 2012 with 100 students in attendance; the attendance has since grown steadily and was up to approximately 300 students by Fall 2013. + +The Cascade SLC has formalized both the hiring process and the training process for casual tutors. +The department chairs interview potential tutors, determine which levels they are qualified to tutor, and give guidance as to tutoring strategies and rules. +During their first term, each new tutor is always scheduled in the learning center at the same time as a math instructor, and is encouraged to seek math and tutoring advice from that instructor. + +\subsubsection{Rock Creek} +Averaging over non-summer terms from Fall 2008 to Spring 2013, the Rock Creek SLC has served about 690 math students with 3300 individual visits and 10 hours per student per term. +(See \vref{app:tut:tab:SLC} for a full accounting.) + +Everyone who works and learns in the Rock Creek SLC is looking forward to moving into the newly-built space in Building 7 by Spring 2014. +The new space will bring the SLC closer to the library and into the same building as the WRC, MC, and TLC. +Students seek tutoring largely in math and science, but increasingly for accounting, computer basics, and also college reading. +Mathematics full-time faculty hold two of the required five office hours at the tutoring center. + +Motivated by the high levels of student demand for math tutoring, in 2012/13 the SLC piloted math tutoring by appointment two days per week. +On each of the two days a tutor leads thirty-minute individual sessions or one-hour group tutoring sessions by appointment for most math levels. +After some tweaking of days and times, we have settled on Tuesdays and Wednesdays. +Students who are seeking a longer, more personalized or intensive tutoring session seem to highly appreciate this new service. + +Finally, the Rock Creek SLC has benefited over the last three years from collaboration with advisors, counselors, librarians, the WRC, MC, and the Career Resource Center in offering a wide variety of workshops as well as resource fairs to support student learning. + +\subsubsection{Southeast} +Averaging over non-summer terms from Fall 2008 to Spring 2013, the Southeast SLC has served about 280 math students with 1200 individual visits and 5 hours per student per term. +(See \vref{app:tut:tab:SLC} for a full accounting.) + +The SE SLC staff is looking forward to its move into the new tutoring center facilities when the new buildings are completed. +In the meantime, it has expanded the math tutoring area by moving the writing tutoring to the back room of the tutoring center. + +Since the SE Tutoring Center opened in 2004, it has gone from serving an average of 200 students per term (including math and other subjects) to serving an average of 350 students per term in math alone. +With this increase in students seeking assistance, the staff has also grown; the SE SLC now has several faculty members who work part time in the tutoring center. + +Many SE math faculty members donate time to the tutoring center. +We have developed a service learning project where calculus students volunteer their time in the tutoring center; this practice has been a great help to students who utilize the tutoring center as well as a great opportunity for calculus students to cement their own mathematical skills. + +\subsubsection{Sylvania} +Averaging over non-summer terms from Fall 2008 to Spring 2013, the Sylvania SLC has served about 1100 math students with 6200 individual visits and 7 hours per student per term. +(See \vref{app:tut:tab:SLC} for a full accounting.) + +The Sylvania SLC moved into a new location in Fall 2012; it is now in the Library building, together with the Student Computing Center. +The creation of a learning commons is working out well and students are taking advantage of having these different study resources in one place. +Unfortunately, the new SLC has less space available for math tutoring than the prior Student Success Center which has been addressed by restructuring the space. +Since enrollment remains high, having enough space for all students seeking help remains a challenge. + +PCC's incredible growth in enrollment created an attendant need for a dramatic increase in the number of tutors available to students. +This increased need has been partially addressed by an increase in the budget set aside for paid tutors as well as a heightened solicitation for volunteer tutors. +Many instructors (both full-time and part-time) have helped by volunteering in the Sylvania SLC; for several years, the center was also able to recruit up to 10 work-study tutors per academic year, but with recent Federal changes to Financial Aid, the Math Center is now only allowed two work-study tutors per year; this restriction has led to a decrease of up to 50 tutoring hours per week. + +In addition to tutoring, the Sylvania SLC hosts the self-paced ALC math classes, provides study material, and offers resources and workshops for students to prepare for the Compass placement test. +Efforts are also underway to modernize a vast library of paper-based materials by putting them online and making them available in alternate formats. + +\section[Student services]{Provide information on how Advising, Counseling, + Disability Services and other student services impact students. } + +Perhaps more than ever, the Math SAC appreciates and values the role of student services in fostering success for our students. +In our development of an NSF-IUSE proposal (see \vref{over:subsub:nsfiuse}), discussions and planning returned again and again to student services such as advising, placement testing, and counseling. +As we look ahead hopefully toward a realization of the structure that we envisioned, we will keep these services as essential partners in serving our students. +The current status of these services follows. + +\subsection{Advising and counseling} +The advising and counseling departments play a vital role in creating pathways for student success; this is especially important when it comes to helping students successfully navigate their mathematics courses. +Historically there have been incidents of miscommunication between various math departments and their campus counterparts in advising, but over the past few years a much more deliberate effort to build strong communication links between the two has resulted in far fewer of these incidents. + +The advising departments have been very responsive to requests made by the mathematics departments and have been clear that there are policies in place that prevent them from implementing some of the changes we would like. + +For example, in the past many advisers would make placement decisions based upon criteria that the Math SAC felt weren't sufficient to support the decision. +One example of this was placing students into classes based upon a university's prerequisite structure rather than PCC's prerequisite structure. +When the advisers were made aware that this frequently led to students enrolling in courses for which they were not prepared for success, the advising department instituted an ironclad policy not to give any student permission to register for a course unless there was documented evidence that the student had passed a class that could be transcribed to PCC as the PCC prerequisite for the course. +Any student who wants permission without a satisfied prerequisite or adequate Compass score is now directed to a math faculty chair or to the instructor of the specific section in which the student wishes to enroll. + +On the downside, there are things we would like the advisers to do that we have come to learn they cannot do. +For example, for several years the policy of the Math SAC has been that prerequisites that were satisfied at other colleges or universities would only be `automatically' accepted if they were less than three years old. +Many instructors in the math department were under the impression that this policy was in place in the advising department, but it was discovered in 2012 that not only is this policy \emph{not} in place but the policy in fact cannot be enforced by anyone (including math faculty). +Apparently such a policy is enforceable only if explicit prerequisite time-limits are written into the CCOGs. + +The advising department had been aware of the prerequisite issue for six or seven years, but somehow the word had not been passed along to the general math faculty. +This serves as an example that both advising supervisors and the math department chairs need to make every effort possible to inform all relevant parties of policy changes in a clear and timely manner. +Towards that end, the math department at Sylvania Campus has now been assigned an official liaison in the Sylvania advising department. +and we believe that similar connections +should be created on the other campuses as well. + +With the college's new focus on student completion, the relationship between the math departments and advising departments needs to become much stronger. +Initial placement plays a critical role in completion, as do other things such as enrollment into necessary study skills classes and consecutive term-to-term enrollment through a sequence of courses. +We need to make sure that the advisers have all of the tools necessary to help students make the best choices and the advisers need to help us understand their perspective on the needs of students enrolling in mathematics courses. +To help establish this collaborative environment, a Math SAC ad hoc committee has been formed to investigate and address advising issues, placement issues, and study skills issues; the committee is going to ask several people involved in advising and counseling to join the committee. +It has been speculated that perhaps such a committee should not be under the direct purview of the Math SAC; if the administration decides to create a similar committee under someone else's direction we ask that any such committee have a large contingent of math faculty. + +\recommendation[PCC Cabinet, Deans of Students, Advising]{All four campuses should have an + official advising liaison and the + four liaisons should themselves have an established relationship. + Ideally we would like to have one adviser at each campus dedicated solely to math advising issues. +} + +\recommendation[Math SAC, Advising, ROOTS]{ A committee consisting of advisers, + math faculty, and other relevant parties + (e.g.\ ROOTS representation) should be formed to investigate and establish + policies related to student success in mathematics courses. + The issues to investigate include, but are not limited to, placement, study skills, and other college success skills as they relate to mathematics courses. +} + +\subsection{Testing centers} +At the time we wrote our last program review there were very uneven procedures at the various testing centers which caused a lot of problems; the inconsistencies were especially problematic for online instructors and their students---see \cite{mathprogramreview2003}, page 26 . +We are pleased that the testing centers recognized that inconsistency as a problem and they addressed the issue in a forthright way. +The testing centers now have uniform policies and they have made great strides in making their services easily accessible to students and instructors alike. +For example, the ability to make testing arrangements online has been a tremendous help as has the increase in the number of options by which a completed exam can be returned to the instructor. + +A limited number of hours of operation remains a problem at each of the testing centers; evening and weekend hours are not offered and testing times during the remaining time are limited; for example, the Cascade Testing Center offers only four start times for make up exams exam week. +It appears to us that the size of the facilities and the number of personnel have not increased in equal parts with the dramatic increase in enrollment. +It also appears that the testing centers have not been given adequate funding to offer hours that accommodate students who can only come to campus during the evening or on a weekend. + +This lack of access can be especially problematic for students registered in math courses. +The majority of the math courses at PCC are taught by part-time faculty and these faculty members do not have the same flexibility in their schedule as full-time faculty to proctor their own exams; as such they are especially dependent on the testing centers for make-up testing. +This dependency is all the more problematic since many part-time faculty teach evening or Saturday classes and many of the students in those classes find it difficult to come to campus during `normal business hours. +' Additionally, the +Sylvania math department simply does not have the space required to +administer make-up testing in the office, so 100\% of its faculty are dependent +upon the testing centers for make-up testing; we realize this puts a strain +on the testing centers. + +\recommendation[PCC Cabinet]{We recommend that the space and staffing in the + testing centers be increased.} + +\recommendation[PCC Cabinet, Deans of Students, Testing Centers]{We recommend that make-up +testing be available as late as 9:00 {\sc p.m.}\ at least two days per week, +and that make-up testing hours be available every Saturday.} + +As discussed on \cpageref{other:page:disabilityservices,needs:page:disabilityservices}, the Math SAC has a very positive and productive relationship with disability services. +For example, disability services was very responsive when some instructors began to question accommodation requests that contradicted specific evaluation criteria mandated in CCOGs (e. +g. testing certain material without +student access to a calculator). +Kaela Parks came to the SAC and assured us that any such accommodation request is something an instructor need only consider; i. +e., those type of accommodation requests are not mandates on the +part of disability services. +The speed with which we received clarity about this issue is indicative of the strong connection that has been forged between the mathematics departments and disability services. + +Beginning in the 2012/13 AY, all communication regarding student accommodations (both general and testing-specific) has been done online. +Because of issues such as notifications being filtered to spam files, not all accommodation requests were being read by faculty. +At the mathematics faculty department chairs' request, Kaela Parks created a spaces page that allow the faculty chairs monitor which instructors have one or more students with accommodation needs and highlights in red any instructor who has an outstanding issue (such as pending exam) that needs immediate attention. +This resource has greatly diminished the number of incidents where a student has an accommodation need that is not addressed in a timely manner. + +\section[Patterns of scheduling]{Describe current patterns of scheduling (such + as modality, class size, duration, DC times, location, or other), address the + pedagogy of the program/discipline and the needs of students.} +%\section[Patterns of scheduling]{Describe current patterns of scheduling (such as such as modality, class size, duration, times, location, or other). How do these relate to the pedagogy of the program/discipline and/or the needs of students?} %new version of the question, from Kendra +\label{facilities:sec:scheduling} +The math departments schedule classes that start as early as 7:00 {\sc a. +m.}\ and +others that run as late as 9:50 {\sc p.m.} +About 80\% of our math classes are offered in a two-day-a week format, meeting either Monday-Wednesday or Tuesday-Thursday. +Some sections are offered in a three-day-a-week format and a few in a four-day-a-week format; sections are offered in these formats to accommodate students who find it helpful to be introduced to less content in any one class session. + +We also schedule classes that meet only once a week; some of those classes are scheduled on Saturdays. +While once-weekly meetings are not an ideal format for teaching mathematics, having such sections creates options for students who cannot attend college more than one day a week. + +We offer several courses online, the enrollment in which has jumped dramatically over the past five years (see \vref{fig:sec3:F2Fenrollments} and the discussion surrounding it). +We also offer classes in both a web/TV hybrid and an online/on-campus hybrid format. + +On-campus class sizes generally range from 20 to 35 students; that number is typically dependent on the room that is assigned for the class (see \cpageref{needs:page:classsize} and \vref{app:sec:classsize}). +This has led to some inconsistencies among campuses as distribution of classroom capacities is not consistent from one campus to the next. + +Teaching online presents unique obstacles for faculty and students alike. +Faculty members, like students, have different methods of addressing these obstacles. +The SAC has a recommended capacity limit of twenty-five for each section on its DL course offerings. +This recommendation was based upon a determination that twenty-five is a reasonable class size given the extra duties associated with teaching online. +Because the attrition rates in online courses can be higher than that in on-campus courses, many DL instructors ask that their class capacity be set at, say, thirty to accommodate for first week attrition. + +In addition to increased class sizes that account for anticipated attrition, some faculty members choose to allow additional students when their workload allows for the attendant extra work. +In fact, during Winter 2014, only fifteen out of a total of forty-one DL sections are limited to twenty-five students. +Of the remaining DL sections, seven are capped between twenty-five and thirty, twelve are capped in the mid-to-low thirties, and seven are capped at greater than forty-five. +Further information about scheduling patterns, broken down by campus, can be found in \vref{sec:app:courseschedule}. + +There is no specific pedagogical dictates in most of our courses. +Class activities can range from lecture to class-discussion to group-work to student-board-work. +Some instructors provide their students with pre-printed lecture notes and examples, others write notes on the board; some instructors have their students work mostly on computer-based activities, and yet others mostly work problems from the textbook. +The frequency with which each instructor uses each approach is almost entirely up to him/her. +Many instructors have a required online homework component, while others do not. + +This diversity of classroom experience has both positive and negative consequences. +On the positive side, it provides an environment that has the potential to address a wide-range of learning styles. +On the negative side, it can lead to very inconsistent experiences for students as they work their way through a sequence. +The inconsistency is probably most prevalent and, unfortunately, most problematic at the DE level of instruction. +As the Math SAC looks for ways to increase completion rates for students who place into developmental mathematics courses, serious attention will be given to plans that increase the consistency of classroom experience for students; consistency that is built upon evidence-based best practices. + diff --git a/test-cases/oneSentencePerLine/pcc-program-review1-mod2.tex b/test-cases/oneSentencePerLine/pcc-program-review1-mod2.tex new file mode 100644 index 00000000..9982be9d --- /dev/null +++ b/test-cases/oneSentencePerLine/pcc-program-review1-mod2.tex @@ -0,0 +1,378 @@ +% arara: pdflatex: {files: [MathSACpr2014]} +% !arara: indent: {overwrite: yes} +\chapter{Facilities and Support} +\begin{flushright} + \includegraphics[width=8cm]{xkcd-806-tech_support-punchline}\\ + \url{http://xkcd.com} +\end{flushright} +\section[Space, technology, and equipment]{Describe how classroom space, classroom technology, laboratory space + and equipment impact student success.} + +Over the past few years, efforts by the college to create classrooms containing the same basic equipment has helped tremendously with consistency issues. +The nearly universal presence of classroom podiums with attendant Audio Visual (AV) devices is considerably useful. +For example, many instructors use computer-based calculator emulators when instructing their students on calculator use---this allows explicit keystroking examples to be demonstrated that were not possible before the podiums appeared; the document cameras found in most classrooms are also used by most mathematics instructors. +Having an instructor computer with internet access has been a great help as instructors have access to a wide variety of tools to engage students, as well as a source for quick answers when unusual questions arise. + +Several classrooms on the Sylvania campus have Starboards or Smart Boards integrated with their AV systems. +Many mathematics instructors use these tools as their primary presentation vehicles; documents can be preloaded into the software and the screens allow instructors to write their work directly onto the document. +Among other things, this makes it easy to save the work into pdf files that can be accessed by students outside of class. +This equipment is not used as much on the other campuses, but there are instructors on other campuses that say they would use them if they were widely available on their campus. + +A few instructors have begun creating lessons with LiveScribe technology. +The technology allows the instructor to make an audio/visual record of their lecture without a computer or third person recording device; instructors can post a `live copy' of their actual class lecture online. +The students do not simply see a static copy of the notes that were written; the students see the notes emerge as they were being written and they hear the words that were spoken while they were written. +The use of LiveScribe technology is strongly supported by Disability Services, and for that reason alone continued experimentation with its use is strongly encouraged. + +Despite all of the improvements that have been made in classrooms over the past few years, there still are some serious issues. + +Rooms are assigned randomly, which often leads to mathematics classes being scheduled in rooms that are not appropriate for a math class. +For example, scheduling a math class in a room with individual student desks creates a lot of problems; many instructors have students take notes, refer to their text, and use their calculator all at the same time and there simply is not enough room on the individual desktops to keep all of that material in place. +More significantly, this furniture is especially ill-suited for group work. +Not only does the movement of desks and sharing of work exacerbate the materials issue (materials frequently falling off the desks), students simply cannot share their work in the efficient way that work can be shared when they are gathered about tables. +It would be helpful if all non-computer-based math classes could be scheduled in rooms with tables. + +Another problem relates to an inadequate number of computerized classrooms and insufficient space in many of the existing computerized classroom; both of these shortages have greatly increased due to Bond-related construction. +Several sections of MTH 243 and MTH 244 (statistics courses), which are normally taught in computerized classrooms, \emph{have} been scheduled in regular classrooms. +Many of the statistics courses that were scheduled in computerized classrooms have been scheduled in rooms that seat only 28, 24, or even 20 students. +When possible, we generally limit our class capacities at 34 or 35. +Needless to say, running multiple sections of classes in rooms well below those capacities creates many problems. +This is especially problematic for student success, as it hinders students' ability to register due to undersized classrooms. + +Finally, the computerized classrooms could be configured in such a way that maximizes potential for meaningful student engagement and minimizes potential for students to get off course due to internet access. +We believe that all computerized classrooms need to come equipped with software that allows the instructor control of the student computers such as LanSchool Classroom Management Software. +The need for this technology is dire; it will reduce or eliminate students being off task when using computers, and it will allow another avenue to facilitate instruction as the instructor will be able to `see' any student computer and `interact' with any student computer. +It can also be used to solicit student feedback in an anonymous manner. +The gathering of anonymous feedback can frequently provide a better gauge of the general level of understanding than activities such as the traditional showing of hands. + +\recommendation[Scheduling]{All mathematics classes should be scheduled in rooms that are either + computerized (upon request) or have multi-person tables (as opposed to + individual desks).} + +\recommendation[Scheduling, Deans of Instruction, PCC Cabinet]{All computerized classrooms + should have at least 30, if not 34, individual work + stations.} + +\recommendation[Multimedia Services, Deans of Instruction, PCC Cabinet]{An adequate number of classrooms on all campuses should be equipped with + Smartboards so that all instructors who want access to the technology can teach + every one of their classes in rooms equipped with the technology.} + +\recommendation[Multimedia Services, TSS]{The disk image for all computerized classrooms should include software that + allows the podium computer direct access to each student + computer. } + +\section[Library and other outside-the-classroom information + resources]{Describe how students are using the library or other + outside-the-classroom information resources. } +We researched this topic by conducting a stratified sampling method survey of 976 on-campus students and 291 online students; the participants were chosen in a random manner. +We gave scantron surveys to the on-campus students and used SurveyMonkey for the online students. +We found that students are generally knowledgeable about library resources and other outside-the-classroom resources. +The complete survey, together with its results, is given in \vref{app:sec:resourcesurvey}; we have summarized our comments to some of the more interesting questions below. + +\begin{enumerate}[label=Q\arabic*.,font=\bf] + \item Not surprisingly, library resources and other campus-based resources are used more frequently by our on-campus students than by our online students. + This could be due to less frequent visits to campus for online students and/or online students already having similar resources available to them via the internet. + \item We found that nearly 70\% of instructors include resource information in their syllabi. + This figure was consistent regardless of the level of the class (DE/transfer level) or the employment status of the instructor (full/part-time). + + We found that a majority of our instructors are using online resources to connect with students. + Online communication between students and instructors is conducted across many platforms such as instructor websites, Desire2Learn, MyPCC, online graphing applications, and online homework platforms. + + We found that students are using external educational websites such as \href{https://www.khanacademy.org/}{Khan Academy}, \href{http://patrickjmt.com/}{PatrickJMT}, \href{http://www.purplemath.com/}{PurpleMath}, and \href{http://www.youtube.com/}{YouTube}. + The data suggest online students use these services more than on-campus students. + \item The use of online homework (such as WeBWorK, MyMathLab, MyStatLab, and ALEKS) has grown significantly over the past few years. + However, the data suggests that significantly more full-time instructors than part-time instructors are directing their students towards these tools (as either a required or optional component of the course). + Additionally, there is a general trend that online homework programs are being used more frequently in online classes than in on-campus classes. + Both of these discrepancies may reflect the need to distribute more information to faculty about these software resources. + \item The Math SAC needs to address whether or not we should be requiring students to use online resources that impose additional costs upon the students and, if so, what would constitute a reasonable cost to the student. + To that end, our survey asked if students would be willing to pay up to \$35 to access online homework and other resources. + We found that online students were more willing to pay an extra fee than those enrolled in on-campus classes. + \setcounter{enumi}{6} + \item The PCC mathematics website offers a wealth of materials that are frequently accessed by students. + These include course-specific supplements, calculator manuals, and the required Calculus I lab manual; all of these materials were written by PCC mathematics faculty. + Students may print these materials for free from any PCC computer lab. + The website also links to PCC-specific information relevant to mathematics students (such as tutoring resources) as well as outside resources (such as the Texas Instruments website). + \setcounter{enumi}{8} + \item In addition to the previously mentioned resources we also encourage students to use resources offered at PCC such as on-campus Student Learning Centers, online tutoring, Collaborate, and/or Elluminate. + A significant number of students registered in on-campus sections are using these resources whereas students enrolled in online sections generally are not. + This is not especially surprising since on-campus students are, well, on campus whereas many online students rarely visit a campus. +\end{enumerate} + +\recommendation[Math SAC]{The majority of our data suggests that students are using a variety of + resources to further their knowledge. + We recommend that instructors continue to educate students about both PCC resources and non-PCC resources. + We need to uniformly encourage students to use resources such as online tutoring, Student Learning Centers, Collaborate, and/or Elluminate; this includes resource citations in each and every course syllabus.} + +\recommendation[Faculty Department Chairs]{A broader education campaign should be engaged to distribute information to part-time faculty regarding online homework such as WeBWorK, MyMathLab, MyStatLab, and ALEKS. +} + +\recommendation[Math SAC]{Instructors should consider quality, accessibility and cost to students when + requiring specific curriculum materials. } + +\section[Clerical, technical, administrative and/or tutoring support]{Provide + information on clerical, technical, administrative and/or tutoring support.} + +The Math SAC has a sizable presence on each of PCC's three campuses and at Southeast Center (soon to be a campus in its own right). +Each campus houses a math department within a division of that campus. +The clerical, technical, administrative, and tutoring support systems are best described on location-by-location basis. + +\subsection{Clerical, technical, and administrative support} + +Across the district, our SAC has an excellent and very involved administrative liaison, Dr. +Alyson Lighthart. +We would like to thank her for her countless hours of support in attending our SAC meetings and being available to the SAC Co-Chairs. +She provides us with thoughtful feedback and insightful perspectives that help us gather our thoughts and make sound decisions. + +\subsubsection{Cascade} +The Cascade math department belongs to the Math, Sciences, Health and PE division. +The math department is located on the third floor of the student services building, sharing a floor with the ROOTS office. +The math department also shares space with allied health support staff, medical professions faculty, medical assisting faculty and the Cascade academic intervention specialists (one of whom is also a math part-time faculty). +Part-time math faculty share 11 cubicles, each with a computer. +Our 7 full-time instructors are paired in offices that open up to the part-time cubicles. +We have space in our offices for another full time faculty member as we lost a temporary full-time position at the start of the 2013 academic year. +In Winter 2014, a collective 42 faculty share one high speed Ricoh printer and one copy machine. +Our division offices are located in another building. +We have a dedicated administrative assistant at the front desk who helps students and faculty most days from 8 {\sc a.m.--5 p.m.} + +\subsubsection{Rock Creek} The Rock Creek math department is located in the same floor as the division it belongs to (Mathematics, Aviation, and Industrial Technology) and it is shared with Computer Science. +Part-time faculty share fourteen cubicles, each with a computer, located in the same office as full-time instructors, that are used to prepare and meet with students. +The sixty-five plus faculty share two high speed printers that can collate, staple and allow double sided printing, and one high speed scanner. +Currently we have reached space capacity and we will have to re-think the current office configuration in order to add one more full-time faculty member next Fall. +Two years ago the Rock Creek math department added a dedicated administrative assistant, which has helped with scheduling needs, coordinating part-time faculty needs, and providing better service to the students. + +\subsubsection{Southeast} +The clerical and administrative setup at Southeast has changed, as of Winter 2014. +There was a recent restructuring of divisions. +What used to be the Liberal Arts and Sciences Division split into two divisions: the Liberal Arts and CTE Division (which is in the first floor of Scott Hall, Room 103, where the Liberal Arts and Sciences used to be) and the Math and Science Division (which is on the \nth{2} floor of the new Student Commons Building, Room 214). +All of the math and science faculty are now in this new space, including the part-time instructors (everybody was scattered before, so this is a welcome change). + +All of the department chairs have their own offices (with doors), while the rest of the faculty (full-time and part-time) occupy cubicle spaces (approximately 20 cubicles in the space, shared by 4--5 faculty per cubicle). +There are two administrative assistants, one of whom is with the math and science faculty and the other of whom is in charge of the STEM program. +There is also one clerical staff member. + +There is one Ricoh printer in the space, along with a fax machine. +Any and all supplies (markers, erasers, etc. +) are located across the hall in a designated +staff room. + +\subsubsection{Sylvania} +The Sylvania math department belongs to the Math and Industrial Technology division, which is located in the neighboring automotive building. +The math department is currently located in two separate areas of adjacent buildings as of Fall 2013, when the developmental math faculty officially merged with the math department. +This separation will soon be remedied by construction of the new math department area, scheduled to be completed during Spring 2014. +This new location will be next door to the Engineering department, and will share a conference room, copy machine room, and kitchen. +The math department will include two department chair offices, seventeen full-time instructor cubicles, six additional cubicles shared by part-time faculty, and two flex-space rooms. +Each of the cubicles will have a computer, and there will be two shared laser printers plus one color scanner in the department office. + +Our two administrative assistants work an overlapped schedule, which provides dual coverage during the busy midday times and allows the office to remain open to students and visitors for eleven hours. +These assistants do an incredible job serving both student and faculty needs, including: scheduling assistance, interfacing with technical support regarding office and classroom equipment, maintaining supplies inventory, arranging for substitute instructors, securing signatures and processing department paperwork, guiding students to campus resources, and organizing syllabi and schedules from approximately 70 math instructors. + +Our math department has frequent interaction with both Audio-Visual and Technology Solution Services. +Responses by AV to instructor needs in the classroom are extremely prompt--typically within minutes of the notification of a problem. +Since the math department is very technology-oriented, we have many needs that require the assistance of TSS. +Work orders for computer equipment and operational issues that arise on individual faculty computers can take quite a long time to be implemented or to be resolved. +This may be due to the sheer volume of requests that they are processing, but more information during the process, especially notes of any delays, would be welcomed. + +\subsection{Tutoring support} +PCC has a Student Learning Center (SLC) on each campus. +It is a testament to PCC's commitment to student success that the four SLCs exist. +However, discrepancies such as unequal distribution of resources, inconsistency in the number and nature of tutors (including faculty `donating time' to the centers), and disparate hours of operation present challenges to students trying to navigate their way through different centers. + +\recommendation[PCC Cabinet, Deans of Students, Deans of Instructions, Student Learning Centers]{The college should strive for more + consistency with its Student Learning Centers. + We feel that the centers would be an even greater resource if they were more consistent in structure, resource availability, physical space, and faculty support.} + +Over the last five years the general environment of PCC has been greatly impacted by historically-unmatched enrollment growth (see \vref{fig:sec3:DLenrollments,fig:sec3:F2Fenrollments}). +PCC's four Student Learning Centers have been greatly affected by this (see \vref{app:sec:tutoringhours}). +Most notably, the number of students seeking math tutoring has increased dramatically. +Unfortunately, this increase in student need has not been met by increase in tutors or tutoring resources. +As a result the amount of attention an individual student receives has decreased in a substantive way, leaving students often frustrated and without the help they needed. +Consequently, the numbers of students dropped again as students stopped even trying. +While some of this growth has been (or will be) accommodated by increasing the physical space available for tutoring (i.e., by the construction of new facilities at Rock Creek and Southeast), that is still not enough since personnel resources were not increased at the same rate and work-study awards have been decreased significantly. +A comprehensive plan needs to be developed and implemented that will ensure each and every student receives high-quality tutoring in a consistent and consistently accessible manner. + +As it now stands, the operation of the SLCs is completely campus driven. +As such, reporting on the current status needs to be done on a campus-by-campus basis. + +\subsubsection{Cascade} +Averaging over non-summer terms from Fall 2008 to Spring 2013, the Cascade SLC has served about 680 math students with 3900 individual visits and 8 hours per student per term. +(See \vref{app:tut:tab:SLC} for a full accounting.) + +The Cascade SLC has increased its operating hours in response to student demand. +Statistics tutoring is now offered at most times and the introduction of online homework has led to `Hybrid Tutoring', where students receive tutoring while working on their online homework. + +At the Cascade Campus, all full-time mathematics instructors and many part-time mathematics instructors volunteer 1--4 hours per week in the SLC to help with student demand. +To help ensure usage throughout the SLC's operational hours, instructors are notified by email of slow-traffic times; this allows the instructors to direct students who need extra help to take advantage of those times. +Other communications such as announcements, ads, and newsletters are sent out regularly. + +Full-time faculty have constructed a `First week lecture series' that they conduct on the first Friday of every term (except summer). +It is designed to review basic skills from MTH 20 through MTH 111. +It is run in 50-minute segments throughout the day with a 10-minute break between each segment. +The first offering of this series began in Winter 2012 with 100 students in attendance; the attendance has since grown steadily and was up to approximately 300 students by Fall 2013. + +The Cascade SLC has formalized both the hiring process and the training process for casual tutors. +The department chairs interview potential tutors, determine which levels they are qualified to tutor, and give guidance as to tutoring strategies and rules. +During their first term, each new tutor is always scheduled in the learning center at the same time as a math instructor, and is encouraged to seek math and tutoring advice from that instructor. + +\subsubsection{Rock Creek} +Averaging over non-summer terms from Fall 2008 to Spring 2013, the Rock Creek SLC has served about 690 math students with 3300 individual visits and 10 hours per student per term. +(See \vref{app:tut:tab:SLC} for a full accounting.) + +Everyone who works and learns in the Rock Creek SLC is looking forward to moving into the newly-built space in Building 7 by Spring 2014. +The new space will bring the SLC closer to the library and into the same building as the WRC, MC, and TLC. +Students seek tutoring largely in math and science, but increasingly for accounting, computer basics, and also college reading. +Mathematics full-time faculty hold two of the required five office hours at the tutoring center. + +Motivated by the high levels of student demand for math tutoring, in 2012/13 the SLC piloted math tutoring by appointment two days per week. +On each of the two days a tutor leads thirty-minute individual sessions or one-hour group tutoring sessions by appointment for most math levels. +After some tweaking of days and times, we have settled on Tuesdays and Wednesdays. +Students who are seeking a longer, more personalized or intensive tutoring session seem to highly appreciate this new service. + +Finally, the Rock Creek SLC has benefited over the last three years from collaboration with advisors, counselors, librarians, the WRC, MC, and the Career Resource Center in offering a wide variety of workshops as well as resource fairs to support student learning. + +\subsubsection{Southeast} +Averaging over non-summer terms from Fall 2008 to Spring 2013, the Southeast SLC has served about 280 math students with 1200 individual visits and 5 hours per student per term. +(See \vref{app:tut:tab:SLC} for a full accounting.) + +The SE SLC staff is looking forward to its move into the new tutoring center facilities when the new buildings are completed. +In the meantime, it has expanded the math tutoring area by moving the writing tutoring to the back room of the tutoring center. + +Since the SE Tutoring Center opened in 2004, it has gone from serving an average of 200 students per term (including math and other subjects) to serving an average of 350 students per term in math alone. +With this increase in students seeking assistance, the staff has also grown; the SE SLC now has several faculty members who work part time in the tutoring center. + +Many SE math faculty members donate time to the tutoring center. +We have developed a service learning project where calculus students volunteer their time in the tutoring center; this practice has been a great help to students who utilize the tutoring center as well as a great opportunity for calculus students to cement their own mathematical skills. + +\subsubsection{Sylvania} +Averaging over non-summer terms from Fall 2008 to Spring 2013, the Sylvania SLC has served about 1100 math students with 6200 individual visits and 7 hours per student per term. +(See \vref{app:tut:tab:SLC} for a full accounting.) + +The Sylvania SLC moved into a new location in Fall 2012; it is now in the Library building, together with the Student Computing Center. +The creation of a learning commons is working out well and students are taking advantage of having these different study resources in one place. +Unfortunately, the new SLC has less space available for math tutoring than the prior Student Success Center which has been addressed by restructuring the space. +Since enrollment remains high, having enough space for all students seeking help remains a challenge. + +PCC's incredible growth in enrollment created an attendant need for a dramatic increase in the number of tutors available to students. +This increased need has been partially addressed by an increase in the budget set aside for paid tutors as well as a heightened solicitation for volunteer tutors. +Many instructors (both full-time and part-time) have helped by volunteering in the Sylvania SLC; for several years, the center was also able to recruit up to 10 work-study tutors per academic year, but with recent Federal changes to Financial Aid, the Math Center is now only allowed two work-study tutors per year; this restriction has led to a decrease of up to 50 tutoring hours per week. + +In addition to tutoring, the Sylvania SLC hosts the self-paced ALC math classes, provides study material, and offers resources and workshops for students to prepare for the Compass placement test. +Efforts are also underway to modernize a vast library of paper-based materials by putting them online and making them available in alternate formats. + +\section[Student services]{Provide information on how Advising, Counseling, + Disability Services and other student services impact students. } + +Perhaps more than ever, the Math SAC appreciates and values the role of student services in fostering success for our students. +In our development of an NSF-IUSE proposal (see \vref{over:subsub:nsfiuse}), discussions and planning returned again and again to student services such as advising, placement testing, and counseling. +As we look ahead hopefully toward a realization of the structure that we envisioned, we will keep these services as essential partners in serving our students. +The current status of these services follows. + +\subsection{Advising and counseling} +The advising and counseling departments play a vital role in creating pathways for student success; this is especially important when it comes to helping students successfully navigate their mathematics courses. +Historically there have been incidents of miscommunication between various math departments and their campus counterparts in advising, but over the past few years a much more deliberate effort to build strong communication links between the two has resulted in far fewer of these incidents. + +The advising departments have been very responsive to requests made by the mathematics departments and have been clear that there are policies in place that prevent them from implementing some of the changes we would like. + +For example, in the past many advisers would make placement decisions based upon criteria that the Math SAC felt weren't sufficient to support the decision. +One example of this was placing students into classes based upon a university's prerequisite structure rather than PCC's prerequisite structure. +When the advisers were made aware that this frequently led to students enrolling in courses for which they were not prepared for success, the advising department instituted an ironclad policy not to give any student permission to register for a course unless there was documented evidence that the student had passed a class that could be transcribed to PCC as the PCC prerequisite for the course. +Any student who wants permission without a satisfied prerequisite or adequate Compass score is now directed to a math faculty chair or to the instructor of the specific section in which the student wishes to enroll. + +On the downside, there are things we would like the advisers to do that we have come to learn they cannot do. +For example, for several years the policy of the Math SAC has been that prerequisites that were satisfied at other colleges or universities would only be `automatically' accepted if they were less than three years old. +Many instructors in the math department were under the impression that this policy was in place in the advising department, but it was discovered in 2012 that not only is this policy \emph{not} in place but the policy in fact cannot be enforced by anyone (including math faculty). +Apparently such a policy is enforceable only if explicit prerequisite time-limits are written into the CCOGs. + +The advising department had been aware of the prerequisite issue for six or seven years, but somehow the word had not been passed along to the general math faculty. +This serves as an example that both advising supervisors and the math department chairs need to make every effort possible to inform all relevant parties of policy changes in a clear and timely manner. +Towards that end, the math department at Sylvania Campus has now been assigned an official liaison in the Sylvania advising department. +and we believe that similar connections +should be created on the other campuses as well. + +With the college's new focus on student completion, the relationship between the math departments and advising departments needs to become much stronger. +Initial placement plays a critical role in completion, as do other things such as enrollment into necessary study skills classes and consecutive term-to-term enrollment through a sequence of courses. +We need to make sure that the advisers have all of the tools necessary to help students make the best choices and the advisers need to help us understand their perspective on the needs of students enrolling in mathematics courses. +To help establish this collaborative environment, a Math SAC ad hoc committee has been formed to investigate and address advising issues, placement issues, and study skills issues; the committee is going to ask several people involved in advising and counseling to join the committee. +It has been speculated that perhaps such a committee should not be under the direct purview of the Math SAC; if the administration decides to create a similar committee under someone else's direction we ask that any such committee have a large contingent of math faculty. + +\recommendation[PCC Cabinet, Deans of Students, Advising]{All four campuses should have an + official advising liaison and the + four liaisons should themselves have an established relationship. + Ideally we would like to have one adviser at each campus dedicated solely to math advising issues.} + +\recommendation[Math SAC, Advising, ROOTS]{ A committee consisting of advisers, math faculty, and other relevant parties (e.g.\ ROOTS representation) should be formed to investigate and establish policies related to student success in mathematics courses. + The issues to investigate include, but are not limited to, placement, study skills, and other college success skills as they relate to mathematics courses.} + +\subsection{Testing centers} At the time we wrote our last program review there were very uneven procedures at the various testing centers which caused a lot of problems; the inconsistencies were especially problematic for online instructors and their students---see \cite{mathprogramreview2003}, page 26 . +We are pleased that the testing centers recognized that inconsistency as a problem and they addressed the issue in a forthright way. +The testing centers now have uniform policies and they have made great strides in making their services easily accessible to students and instructors alike. +For example, the ability to make testing arrangements online has been a tremendous help as has the increase in the number of options by which a completed exam can be returned to the instructor. + +A limited number of hours of operation remains a problem at each of the testing centers; evening and weekend hours are not offered and testing times during the remaining time are limited; for example, the Cascade Testing Center offers only four start times for make up exams exam week. +It appears to us that the size of the facilities and the number of personnel have not increased in equal parts with the dramatic increase in enrollment. +It also appears that the testing centers have not been given adequate funding to offer hours that accommodate students who can only come to campus during the evening or on a weekend. + +This lack of access can be especially problematic for students registered in math courses. +The majority of the math courses at PCC are taught by part-time faculty and these faculty members do not have the same flexibility in their schedule as full-time faculty to proctor their own exams; as such they are especially dependent on the testing centers for make-up testing. +This dependency is all the more problematic since many part-time faculty teach evening or Saturday classes and many of the students in those classes find it difficult to come to campus during `normal business hours. +' Additionally, the +Sylvania math department simply does not have the space required to +administer make-up testing in the office, so 100\% of its faculty are dependent +upon the testing centers for make-up testing; we realize this puts a strain +on the testing centers. + +\recommendation[PCC Cabinet]{We recommend that the space and staffing in the + testing centers be increased.} + +\recommendation[PCC Cabinet, Deans of Students, Testing Centers]{We recommend that make-up +testing be available as late as 9:00 {\sc p.m.}\ at least two days per week, +and that make-up testing hours be available every Saturday.} + +As discussed on \cpageref{other:page:disabilityservices,needs:page:disabilityservices}, the Math SAC has a very positive and productive relationship with disability services. +For example, disability services was very responsive when some instructors began to question accommodation requests that contradicted specific evaluation criteria mandated in CCOGs (e.g. testing certain material without student access to a calculator). +Kaela Parks came to the SAC and assured us that any such accommodation request is something an instructor need only consider; i.e., those type of accommodation requests are not mandates on the part of disability services. +The speed with which we received clarity about this issue is indicative of the strong connection that has been forged between the mathematics departments and disability services. + +Beginning in the 2012/13 AY, all communication regarding student accommodations (both general and testing-specific) has been done online. +Because of issues such as notifications being filtered to spam files, not all accommodation requests were being read by faculty. +At the mathematics faculty department chairs' request, Kaela Parks created a spaces page that allow the faculty chairs monitor which instructors have one or more students with accommodation needs and highlights in red any instructor who has an outstanding issue (such as pending exam) that needs immediate attention. +This resource has greatly diminished the number of incidents where a student has an accommodation need that is not addressed in a timely manner. + +\section[Patterns of scheduling]{Describe current patterns of scheduling (such + as modality, class size, duration, DC times, location, or other), address the + pedagogy of the program/discipline and the needs of students.} +%\section[Patterns of scheduling]{Describe current patterns of scheduling (such as such as modality, class size, duration, times, location, or other). How do these relate to the pedagogy of the program/discipline and/or the needs of students?} %new version of the question, from Kendra +\label{facilities:sec:scheduling} +The math departments schedule classes that start as early as 7:00 {\sc a.m.}\ and others that run as late as 9:50 {\sc p.m.} About 80\% of our math classes are offered in a two-day-a week format, meeting either Monday-Wednesday or Tuesday-Thursday. +Some sections are offered in a three-day-a-week format and a few in a four-day-a-week format; sections are offered in these formats to accommodate students who find it helpful to be introduced to less content in any one class session. + +We also schedule classes that meet only once a week; some of those classes are scheduled on Saturdays. +While once-weekly meetings are not an ideal format for teaching mathematics, having such sections creates options for students who cannot attend college more than one day a week. + +We offer several courses online, the enrollment in which has jumped dramatically over the past five years (see \vref{fig:sec3:F2Fenrollments} and the discussion surrounding it). +We also offer classes in both a web/TV hybrid and an online/on-campus hybrid format. + +On-campus class sizes generally range from 20 to 35 students; that number is typically dependent on the room that is assigned for the class (see \cpageref{needs:page:classsize} and \vref{app:sec:classsize}). +This has led to some inconsistencies among campuses as distribution of classroom capacities is not consistent from one campus to the next. + +Teaching online presents unique obstacles for faculty and students alike. +Faculty members, like students, have different methods of addressing these obstacles. +The SAC has a recommended capacity limit of twenty-five for each section on its DL course offerings. +This recommendation was based upon a determination that twenty-five is a reasonable class size given the extra duties associated with teaching online. +Because the attrition rates in online courses can be higher than that in on-campus courses, many DL instructors ask that their class capacity be set at, say, thirty to accommodate for first week attrition. + +In addition to increased class sizes that account for anticipated attrition, some faculty members choose to allow additional students when their workload allows for the attendant extra work. +In fact, during Winter 2014, only fifteen out of a total of forty-one DL sections are limited to twenty-five students. +Of the remaining DL sections, seven are capped between twenty-five and thirty, twelve are capped in the mid-to-low thirties, and seven are capped at greater than forty-five. +Further information about scheduling patterns, broken down by campus, can be found in \vref{sec:app:courseschedule}. + +There is no specific pedagogical dictates in most of our courses. +Class activities can range from lecture to class-discussion to group-work to student-board-work. +Some instructors provide their students with pre-printed lecture notes and examples, others write notes on the board; some instructors have their students work mostly on computer-based activities, and yet others mostly work problems from the textbook. +The frequency with which each instructor uses each approach is almost entirely up to him/her. +Many instructors have a required online homework component, while others do not. + +This diversity of classroom experience has both positive and negative consequences. +On the positive side, it provides an environment that has the potential to address a wide-range of learning styles. +On the negative side, it can lead to very inconsistent experiences for students as they work their way through a sequence. +The inconsistency is probably most prevalent and, unfortunately, most problematic at the DE level of instruction. +As the Math SAC looks for ways to increase completion rates for students who place into developmental mathematics courses, serious attention will be given to plans that increase the consistency of classroom experience for students; consistency that is built upon evidence-based best practices. + diff --git a/test-cases/oneSentencePerLine/pcc-program-review1.tex b/test-cases/oneSentencePerLine/pcc-program-review1.tex new file mode 100644 index 00000000..9ff054f8 --- /dev/null +++ b/test-cases/oneSentencePerLine/pcc-program-review1.tex @@ -0,0 +1,657 @@ +% arara: pdflatex: {files: [MathSACpr2014]} +% !arara: indent: {overwrite: yes} +\chapter{Facilities and Support} +\begin{flushright} + \includegraphics[width=8cm]{xkcd-806-tech_support-punchline}\\ + \url{http://xkcd.com} +\end{flushright} +\section[Space, technology, and equipment]{Describe how classroom space, classroom technology, laboratory space +and equipment impact student success.} + +Over the past few years, efforts by the college to create classrooms containing +the same basic equipment has helped tremendously with consistency issues. The +nearly universal presence of classroom podiums with attendant Audio Visual (AV) devices is +considerably useful. For example, many instructors use computer-based +calculator emulators when instructing their students on calculator use---this +allows explicit keystroking examples to be demonstrated that were not possible +before the podiums appeared; the document cameras found in most classrooms are +also used by most mathematics instructors. Having an instructor computer with +internet access has been a great help as instructors have access to a wide +variety of tools to engage students, as well as a source for quick answers when +unusual questions arise. + +Several classrooms on the Sylvania campus have Starboards or Smart Boards +integrated with their AV systems. Many mathematics instructors use these tools +as their primary presentation vehicles; documents can be preloaded into the +software and the screens allow instructors to write their work directly onto +the document. Among other things, this makes it easy to save the work into pdf +files that can be accessed by students outside of class. This equipment is not +used as much on the other campuses, but there are instructors on other campuses +that say they would use them if they were widely available on their campus. + +A few instructors have begun creating lessons with LiveScribe technology. The +technology allows the instructor to make an audio/visual record of their +lecture without a computer or third person recording device; instructors can +post a `live copy' of their actual class lecture online. The students do not +simply see a static copy of the +notes that were written; the students see the notes emerge as they were being +written and they hear the words that were spoken while they were written. The +use of LiveScribe technology is strongly supported by Disability Services, and +for that reason alone continued experimentation with its use is strongly +encouraged. + +Despite all of the improvements that have been made in classrooms over the past +few years, there still are some serious issues. + +Rooms are assigned randomly, which often leads to mathematics classes being +scheduled in rooms that are not appropriate for a math class. For example, +scheduling a math class in a room with individual student desks creates a lot +of problems; many instructors have students take notes, refer to their text, +and use their calculator all at the same time and there simply is not enough +room on the individual desktops to keep all of that material in place. More +significantly, this furniture is especially ill-suited for group work. Not +only does the movement of desks and sharing of work exacerbate the materials +issue (materials frequently falling off the desks), students simply cannot +share their work in the efficient way that work can be shared when they are +gathered about tables. It would be helpful if all non-computer-based math +classes could be scheduled in rooms with tables. + +Another problem relates to an inadequate number of computerized classrooms and +insufficient space in many of the existing computerized classroom; both of +these shortages have greatly increased due to Bond-related construction. +Several sections of MTH 243 and MTH 244 (statistics courses), which are +normally taught in computerized classrooms, \emph{have} been scheduled in regular +classrooms. Many of the statistics courses that were scheduled in +computerized classrooms have been scheduled in rooms that seat only 28, 24, or +even 20 students. When possible, we generally limit our class capacities at 34 +or 35. Needless to say, running multiple sections of classes in rooms well +below those capacities creates many problems. This is especially problematic +for student success, as it hinders students' ability to register due to +undersized classrooms. + +Finally, the computerized classrooms could be configured in such a way that +maximizes potential for meaningful student engagement and minimizes potential +for students to get off course due to internet access. We believe that all +computerized classrooms need to come equipped with software that allows the +instructor control of the student computers such as LanSchool Classroom +Management Software. The need for this technology is dire; it will reduce or +eliminate students being off task when using computers, and it will allow +another avenue to facilitate instruction as the instructor will be able to +`see' any student computer and `interact' with any student computer. It can +also be used to solicit student feedback in an anonymous manner. The gathering +of anonymous feedback can frequently provide a better gauge of the general +level of understanding than activities such as the traditional showing of +hands. + +\recommendation[Scheduling]{All mathematics classes should be scheduled in rooms that are either + computerized (upon request) or have multi-person tables (as opposed to +individual desks).} + +\recommendation[Scheduling, Deans of Instruction, PCC Cabinet]{All computerized classrooms + should have at least 30, if not 34, individual work +stations.} + +\recommendation[Multimedia Services, Deans of Instruction, PCC Cabinet]{An adequate number of classrooms on all campuses should be equipped with + Smartboards so that all instructors who want access to the technology can teach +every one of their classes in rooms equipped with the technology.} + +\recommendation[Multimedia Services, TSS]{The disk image for all computerized classrooms should include software that + allows the podium computer direct access to each student +computer. } + +\section[Library and other outside-the-classroom information +resources]{Describe how students are using the library or other +outside-the-classroom information resources. } +We researched this topic by conducting a stratified sampling method +survey of 976 on-campus students and 291 online students; the participants were +chosen in a random manner. We gave scantron surveys to the on-campus students +and used SurveyMonkey for the online students. We found that students are +generally knowledgeable about library resources and other outside-the-classroom +resources. The complete survey, together with its results, is given in +\vref{app:sec:resourcesurvey}; we have summarized our comments to some of the +more interesting questions below. + +\begin{enumerate}[label=Q\arabic*.,font=\bf] + \item Not surprisingly, library resources and other campus-based resources + are used more frequently by our on-campus students than by our online + students. This could be due to less frequent visits to campus for online + students and/or online students already having similar resources available + to them via the internet. + \item We found that nearly 70\% of instructors include resource information + in their syllabi. This figure was consistent regardless of the level of + the class (DE/transfer level) or the employment status of the instructor + (full/part-time). + + We found that a majority of our instructors are using online resources to + connect with students. Online communication between students and + instructors is conducted across many platforms such as instructor websites, + Desire2Learn, MyPCC, online graphing applications, and online homework + platforms. + + We found that students are using external educational websites such as + \href{https://www.khanacademy.org/}{Khan Academy}, + \href{http://patrickjmt.com/}{PatrickJMT}, + \href{http://www.purplemath.com/}{PurpleMath}, and + \href{http://www.youtube.com/}{YouTube}. The data suggest online + students use these services more than on-campus students. + \item The use of online homework (such as WeBWorK, MyMathLab, MyStatLab, and + ALEKS) has grown significantly over the past few years. However, the data + suggests that significantly more full-time instructors than part-time + instructors are directing their students towards these tools (as either a + required or optional component of the course). Additionally, there is a + general trend that online homework programs are being used more frequently + in online classes than in on-campus classes. Both of these discrepancies + may reflect the need to distribute more information to faculty about these + software resources. + \item The Math SAC needs to address whether or not we should be requiring + students to use online resources that impose additional costs upon the + students and, if so, what would constitute a reasonable cost to the + student. To that end, our survey asked if students would be willing to pay + up to \$35 to access online homework and other resources. We found that + online students were more willing to pay an extra fee than those enrolled + in on-campus classes. + \setcounter{enumi}{6} + \item The PCC mathematics website offers a wealth of materials that are + frequently accessed by students. These include course-specific supplements, + calculator manuals, and the required Calculus I lab manual; all of these + materials were written by PCC mathematics faculty. Students may print + these materials for free from any PCC computer lab. The website also links + to PCC-specific information relevant to mathematics students (such as + tutoring resources) as well as outside resources (such as the Texas + Instruments website). + \setcounter{enumi}{8} + \item In addition to the previously mentioned resources we also encourage + students to use resources offered at PCC such as on-campus Student Learning + Centers, online tutoring, Collaborate, and/or Elluminate. A significant + number of students registered in on-campus sections are using these + resources whereas students enrolled in online sections generally are not. + This is not especially surprising since on-campus students are, well, on + campus whereas many online students rarely visit a campus. +\end{enumerate} + +\recommendation[Math SAC]{The majority of our data suggests that students are using a variety of + resources to further their knowledge. We recommend that instructors continue to + educate students about both PCC resources and non-PCC resources. We need to + uniformly encourage students to use resources such as online tutoring, Student + Learning Centers, Collaborate, and/or Elluminate; this includes resource +citations in each and every course syllabus.} + +\recommendation[Faculty Department Chairs]{A broader education campaign should be engaged to distribute information to + part-time faculty regarding online homework such as WeBWorK, MyMathLab, +MyStatLab, and ALEKS. } + +\recommendation[Math SAC]{Instructors should consider quality, accessibility and cost to students when +requiring specific curriculum materials. } + +\section[Clerical, technical, administrative and/or tutoring support]{Provide +information on clerical, technical, administrative and/or tutoring support.} + +The Math SAC has a sizable presence on each of PCC's three campuses and at Southeast Center (soon to be +a campus in its own right). Each campus houses a math department within a +division of that campus. The clerical, technical, administrative, and tutoring +support systems are best described on location-by-location basis. + +\subsection{Clerical, technical, and administrative support} + +Across the district, our SAC has an excellent and very involved administrative +liaison, Dr. Alyson Lighthart. We would like to thank her for her countless +hours of support in attending our SAC meetings and being available to the SAC +Co-Chairs. She provides us with thoughtful feedback and insightful perspectives +that help us gather our thoughts and make sound decisions. + +\subsubsection{Cascade} +The Cascade math department belongs to the Math, Sciences, Health and PE +division. The math department is located on the third floor of the student +services building, sharing a floor with the ROOTS office. The math department +also shares space with allied health support staff, medical professions +faculty, medical assisting faculty and the Cascade academic intervention +specialists (one of whom is also a math part-time faculty). Part-time math +faculty share 11 cubicles, each with a computer. Our 7 full-time instructors +are paired in offices that open up to the part-time cubicles. We have space in +our offices for another full time faculty member as we lost a temporary +full-time position at the start of the 2013 academic year. In Winter 2014, a +collective 42 faculty share one high speed Ricoh printer and one copy machine. +Our division offices are located in another building. We have a dedicated +administrative assistant at the front desk who helps students and faculty most +days from 8 {\sc a.m.--5 p.m.} + +\subsubsection{Rock Creek} +The Rock Creek math department is located in the same floor as the division it +belongs to (Mathematics, Aviation, and Industrial Technology) and it is shared +with Computer Science. Part-time faculty share fourteen cubicles, each with a +computer, located in the same office as full-time instructors, that are used to +prepare and meet with students. The sixty-five plus faculty share two high +speed printers that can collate, staple and allow double sided printing, and +one high speed scanner. Currently we have reached space capacity and we will +have to re-think the current office configuration in order to add one more +full-time faculty member next Fall. Two years ago the Rock Creek math +department added a dedicated administrative assistant, which has helped with +scheduling needs, coordinating part-time faculty needs, and providing better +service to the students. + +\subsubsection{Southeast} +The clerical and administrative setup at Southeast has changed, as of Winter +2014. There was a recent restructuring of divisions. What used to be the +Liberal Arts and Sciences Division split into two divisions: the Liberal Arts +and CTE Division (which is in the first floor of Scott Hall, Room 103, where +the Liberal Arts and Sciences used to be) and the Math and Science Division +(which is on the \nth{2} floor of the new Student Commons Building, Room 214). +All of the math and science faculty are now in this new space, including the +part-time instructors (everybody was scattered before, so this is a welcome +change). + +All of the department chairs have their own offices (with doors), while the +rest of the faculty (full-time and part-time) occupy cubicle spaces +(approximately 20 cubicles in the space, shared by 4--5 faculty per cubicle). +There are two administrative assistants, one of whom is with the math and +science faculty and the other of whom is in charge of the STEM program. There +is also one clerical staff member. + +There is one Ricoh printer in the space, along with a fax machine. Any and all +supplies (markers, erasers, etc.) are located across the hall in a designated +staff room. + +\subsubsection{Sylvania} +The Sylvania math department belongs to the Math and Industrial Technology +division, which is located in the neighboring automotive building. The math +department is currently located in two separate areas of adjacent buildings as +of Fall 2013, when the developmental math faculty officially merged with the +math department. This separation will soon be remedied by construction of the +new math department area, scheduled to be completed during Spring 2014. This +new location will be next door to the Engineering department, and will share a +conference room, copy machine room, and kitchen. The math department will +include two department chair offices, seventeen full-time instructor cubicles, +six additional cubicles shared by part-time faculty, and two flex-space rooms. +Each of the cubicles will have a computer, and there will be two shared laser +printers plus one color scanner in the department office. + +Our two administrative assistants work an overlapped schedule, which provides +dual coverage during the busy midday times and allows the office to remain +open to students and visitors for eleven hours. These assistants do an +incredible job serving both student and faculty needs, including: scheduling +assistance, interfacing with technical support regarding office and classroom +equipment, maintaining supplies inventory, arranging for substitute +instructors, securing signatures and processing department paperwork, guiding +students to campus resources, and organizing syllabi and schedules from +approximately 70 math instructors. + +Our math department has frequent interaction with both Audio-Visual and +Technology Solution Services. Responses by AV to instructor needs in the +classroom are extremely prompt--typically within minutes of the notification of +a problem. Since the math department is very technology-oriented, we have many +needs that require the assistance of TSS. Work orders for computer equipment +and operational issues that arise on individual faculty computers can take +quite a long time to be implemented or to be resolved. This may be due to the +sheer volume of requests that they are processing, but more information during +the process, especially notes of any delays, would be welcomed. + +\subsection{Tutoring support} +PCC has a Student Learning Center (SLC) on each campus. It is a +testament to PCC's commitment to student success that the four SLCs exist. +However, discrepancies such as unequal distribution of resources, inconsistency +in the number and nature of tutors (including faculty `donating time' to the +centers), and disparate hours +of operation present challenges to students trying to navigate their way +through different centers. + +\recommendation[PCC Cabinet, Deans of Students, Deans of Instructions, Student Learning Centers]{The college should strive for more + consistency with its Student Learning Centers. We feel that the centers would + be an even greater resource if they were more consistent in structure, resource +availability, physical space, and faculty support.} + +Over the last five years the general environment of PCC has been greatly +impacted by historically-unmatched enrollment growth (see +\vref{fig:sec3:DLenrollments,fig:sec3:F2Fenrollments}). PCC's four Student +Learning Centers have been greatly affected by this (see \vref{app:sec:tutoringhours}). +Most notably, the number of students seeking math tutoring has +increased dramatically. Unfortunately, this increase in student need has not +been met by increase in tutors or tutoring resources. As a result the +amount of attention an individual student receives has decreased in a +substantive way, leaving students often frustrated and without the help they +needed. Consequently, the numbers of students dropped again as students stopped +even trying. While some of this growth has been (or will be) accommodated +by increasing the physical space available for tutoring (i.e., by the +construction of new facilities at Rock Creek and Southeast), +that is still not enough since personnel resources were not increased at the +same rate and work-study awards have been decreased significantly. A +comprehensive plan needs to be developed and implemented that will ensure each +and every student receives high-quality tutoring in a consistent and +consistently accessible manner. + +As it now stands, the operation of the SLCs is completely campus driven. As +such, reporting on the current status needs to be done on a campus-by-campus +basis. + +\subsubsection{Cascade} +Averaging over non-summer terms from Fall 2008 to Spring 2013, the Cascade SLC has served about +680 math students with 3900 individual visits and 8 hours per student per term. +(See \vref{app:tut:tab:SLC} for a full accounting.) + +The Cascade SLC has increased its operating hours in response to student +demand. Statistics tutoring is now offered at most times and the introduction of +online homework has led to `Hybrid Tutoring', where students receive tutoring +while working on their online homework. + +At the Cascade Campus, all full-time mathematics instructors and many part-time +mathematics instructors volunteer 1--4 hours per week in the SLC to help with +student demand. To help ensure usage throughout the SLC's operational hours, +instructors are notified by email of slow-traffic times; this allows the +instructors to direct students who need extra help to take advantage of those +times. Other communications such as announcements, ads, and newsletters are +sent out regularly. + +Full-time faculty have constructed a `First week lecture series' that they +conduct on the first Friday of every term (except summer). It is designed to +review basic skills from MTH 20 through MTH 111. It is run in 50-minute +segments throughout the day with a 10-minute break between each segment. The +first offering of this series began in Winter 2012 with 100 students in +attendance; the attendance has since grown steadily and was up to +approximately 300 students by Fall 2013. + +The Cascade SLC has formalized both the hiring process and the training process +for casual tutors. The department chairs interview potential tutors, determine +which levels they are qualified to tutor, and give guidance as to tutoring +strategies and rules. During their first term, each new tutor is always +scheduled in the learning center at the same time as a math instructor, and is +encouraged to seek math +and tutoring advice from that instructor. + +\subsubsection{Rock Creek} +Averaging over non-summer terms from Fall 2008 to Spring 2013, the Rock Creek SLC has served about +690 math students with 3300 individual visits and 10 hours per student per term. (See \vref{app:tut:tab:SLC} for a full accounting.) + +Everyone who works and learns in the Rock Creek SLC is looking forward to +moving into the newly-built space in Building 7 by Spring 2014. The new space +will bring the SLC closer to the library and into the same building as the WRC, +MC, and TLC. Students seek tutoring largely in math and science, but +increasingly for accounting, computer basics, and also college reading. +Mathematics full-time faculty hold two of the required five office hours at the +tutoring center. + +Motivated by the high levels of student demand for math tutoring, in 2012/13 +the SLC piloted math tutoring by appointment two days per week. On each of the +two days a tutor leads thirty-minute individual sessions or one-hour group +tutoring sessions by appointment for most math levels. After some tweaking of +days and times, we have settled on Tuesdays and Wednesdays. Students who are +seeking a longer, more personalized or intensive tutoring session seem to +highly appreciate this new service. + +Finally, the Rock Creek SLC has benefited over the last three years from collaboration +with advisors, counselors, librarians, the WRC, MC, and the Career Resource +Center in offering a wide variety of workshops as well as resource fairs to +support student learning. + +\subsubsection{Southeast} +Averaging over non-summer terms from Fall 2008 to Spring 2013, the Southeast SLC has served about +280 math students with 1200 individual visits and 5 hours per student per term. (See \vref{app:tut:tab:SLC} for a full accounting.) + +The SE SLC staff is looking forward to its move into the new tutoring center +facilities when the new buildings are completed. In the meantime, it has +expanded the math tutoring area by moving the writing tutoring to the back room +of the tutoring center. + +Since the SE Tutoring Center opened in 2004, it has gone from serving an +average of 200 students per term (including math and other subjects) to serving +an average of 350 students per term in math alone. With this increase in +students +seeking assistance, the staff has also grown; the SE SLC now has several faculty +members who work part time in the tutoring center. + +Many SE math faculty members donate time to the tutoring center. We have +developed a service learning project where calculus students volunteer their +time in the tutoring center; this practice has been a great help to +students who utilize the tutoring center as well as a great opportunity for +calculus students to cement their own mathematical skills. + +\subsubsection{Sylvania} +Averaging over non-summer terms from Fall 2008 to Spring 2013, the Sylvania SLC has served about +1100 math students with 6200 individual visits and 7 hours per student per +term. (See \vref{app:tut:tab:SLC} for a full accounting.) + +The Sylvania SLC moved into a new location in Fall 2012; it is now in +the Library building, together with the Student Computing Center. The creation +of a learning commons is working out well and students are taking advantage of +having these different study resources in one place. Unfortunately, the new SLC +has less space available for math tutoring than the prior Student Success Center +which has been addressed by restructuring the space. Since enrollment remains high, having enough space +for all students seeking help remains a challenge. + +PCC's incredible growth in enrollment created an attendant need for a dramatic +increase in the number of tutors available to students. This increased need has +been partially addressed by an increase in the budget set aside for paid tutors +as well as a heightened solicitation for volunteer tutors. Many +instructors (both full-time and part-time) have helped by volunteering in the +Sylvania SLC; for several years, the center was also able to recruit up to 10 +work-study tutors per academic year, but with recent Federal changes to +Financial Aid, the Math Center is now only allowed two work-study tutors per +year; this restriction has led to a decrease of up to 50 tutoring hours per +week. + +In addition to tutoring, the Sylvania SLC hosts the self-paced ALC math +classes, provides study material, and offers resources and workshops for +students to prepare for the Compass placement test. Efforts are also underway +to modernize a vast library of paper-based materials by putting them online and +making them available in alternate formats. + + +\section[Student services]{Provide information on how Advising, Counseling, +Disability Services and other student services impact students. } + +Perhaps more than ever, the Math SAC appreciates and values the role of student +services in fostering success for our +students. In our development of an NSF-IUSE proposal (see +\vref{over:subsub:nsfiuse}), discussions and +planning returned again and again to student services such as advising, +placement testing, and counseling. As we look ahead hopefully toward a +realization of the structure that we envisioned, we will keep these services as +essential partners in serving our students. The current status of these +services follows. + +\subsection{Advising and counseling} +The advising and counseling departments play a vital role in creating pathways +for student success; this is especially important when it comes to helping +students successfully navigate their mathematics courses. Historically there +have been incidents of miscommunication between various math departments and +their campus counterparts in advising, but over the past few years a much more +deliberate effort to build strong communication links between the two has +resulted in far fewer of these incidents. + +The advising departments have been very responsive to requests made by the +mathematics departments and have been clear that there are +policies in place that prevent them from implementing some of the changes we +would like. + +For example, in the past many advisers would make placement decisions based +upon criteria that the Math SAC felt weren't sufficient to support the +decision. One example of this was placing students into classes based upon a +university's prerequisite structure rather than PCC's prerequisite structure. +When the advisers were made aware that this frequently led to students +enrolling in courses for which they were not prepared for success, the advising +department instituted an ironclad policy not to give any student permission to +register for a course unless there was documented evidence that the student had +passed a class that could be transcribed to PCC as the PCC prerequisite for +the course. Any student who wants permission without a satisfied prerequisite +or adequate Compass score is now directed to a math faculty chair or to the +instructor of the specific section in which the student wishes to enroll. + +On the downside, there are things we would like the advisers to do that we +have come to learn they cannot do. For example, for several years the policy +of the Math SAC has been that prerequisites that were satisfied at other +colleges or universities would only be `automatically' accepted if they were +less than three years old. Many instructors in the math department were under +the impression that this policy was in place in the advising department, but it +was discovered in 2012 that not only is this policy \emph{not} in place but the +policy in fact cannot be enforced by anyone +(including math faculty). Apparently such a policy is enforceable only if +explicit prerequisite time-limits are written into the CCOGs. + +The advising department had been aware of the prerequisite issue for six or +seven years, but somehow the word had not been passed along to the general math +faculty. This serves as an example that both advising supervisors and the math +department chairs need to make every effort possible to inform all relevant +parties of policy changes in a clear and timely manner. Towards that end, the +math department at Sylvania Campus has now been assigned an official liaison in +the Sylvania advising department. and we believe that similar connections +should be created on the other campuses as well. + +With the college's new focus on student completion, the relationship between +the math departments and advising departments needs to become much stronger. +Initial placement plays a critical role in completion, as do other things such +as enrollment into necessary study skills classes and consecutive term-to-term +enrollment through a sequence of courses. We need to make sure that the +advisers have all of the tools necessary to help students make the best choices +and the advisers need to help us understand their perspective on the needs of +students enrolling in mathematics courses. To help establish this +collaborative environment, a Math SAC ad hoc committee has been formed to +investigate and address advising issues, placement issues, and study +skills issues; the committee is going to ask several people involved in +advising and counseling to join the committee. It has been speculated that +perhaps such a committee should not be under the direct purview of the Math +SAC; if the administration decides to create a similar committee under +someone else's direction we ask that any such committee have a large contingent +of math faculty. + +\recommendation[PCC Cabinet, Deans of Students, Advising]{All four campuses should have an + official advising liaison and the + four liaisons should themselves have an established relationship. Ideally we + would like to have one adviser at each campus dedicated solely to math advising +issues.} + +\recommendation[Math SAC, Advising, ROOTS]{ A committee consisting of advisers, + math faculty, and other relevant parties + (e.g.\ ROOTS representation) should be formed to investigate and establish + policies related to student success in mathematics courses. The issues to + investigate include, but are not limited to, placement, study skills, and +other college success skills as they relate to mathematics courses.} + +\subsection{Testing centers} +At the time we wrote our last program review there were very uneven procedures +at the various testing centers which caused a lot of problems; the +inconsistencies were especially problematic for online instructors and their +students---see \cite{mathprogramreview2003}, page 26 . We are pleased that the testing centers recognized that +inconsistency as a problem and they addressed the issue in a forthright way. +The testing centers now have uniform policies and they have made great strides +in making their services easily accessible to students and instructors alike. +For example, the ability to make testing arrangements online has been a +tremendous help as has the increase in the number of options by which a +completed exam can be returned to the instructor. + +A limited number of hours of operation remains a problem at each of the testing +centers; evening and weekend hours are not offered and testing times during +the remaining time are limited; for example, the Cascade Testing Center +offers only four start times for make up exams exam week. It appears to us that the size of the +facilities and the number of personnel have not increased in equal parts with +the dramatic increase in enrollment. It also appears that the testing centers +have not been given adequate funding to offer hours that accommodate students +who can only come to campus during the evening or on a weekend. + +This lack of access can be especially problematic for students registered in +math courses. The majority of the math courses at PCC are taught by part-time +faculty and these faculty members do not have the same flexibility in their +schedule as full-time faculty to proctor their own exams; as such they are +especially dependent on the testing centers for make-up testing. This +dependency is all the more problematic since many part-time faculty teach +evening or Saturday classes and many of the students in those classes find it +difficult to come to campus during `normal business hours.' Additionally, the +Sylvania math department simply does not have the space required to +administer make-up testing in the office, so 100\% of its faculty are dependent +upon the testing centers for make-up testing; we realize this puts a strain +on the testing centers. + +\recommendation[PCC Cabinet]{We recommend that the space and staffing in the +testing centers be increased.} + +\recommendation[PCC Cabinet, Deans of Students, Testing Centers]{We recommend that make-up + testing be available as late as 9:00 {\sc p.m.}\ at least two days per week, +and that make-up testing hours be available every Saturday.} + +As discussed on \cpageref{other:page:disabilityservices,needs:page:disabilityservices}, +the Math SAC has a very positive and productive relationship with disability +services. For example, disability services was very responsive when some +instructors began to question accommodation requests that contradicted specific +evaluation criteria mandated in CCOGs (e.g. testing certain material without +student access to a calculator). Kaela Parks came to the SAC and assured us +that any such accommodation request is something an instructor need only +consider; i.e., those type of accommodation requests are not mandates on the +part of disability services. The speed with which we received clarity about +this issue is indicative of the strong connection that has been forged between +the mathematics departments and disability services. + +Beginning in the 2012/13 AY, all communication regarding student accommodations +(both general and testing-specific) has been done online. +Because of issues such as notifications being filtered to spam files, not all +accommodation requests were being read by faculty. At the mathematics faculty +department chairs' request, Kaela Parks created a spaces page that allow the +faculty chairs monitor which instructors have one or more students with +accommodation needs and highlights in red any instructor who has an outstanding +issue (such as pending exam) that needs immediate attention. This resource has +greatly diminished the number of incidents where a student has an +accommodation need that is not addressed in a timely manner. + +\section[Patterns of scheduling]{Describe current patterns of scheduling (such + as modality, class size, duration, DC times, location, or other), address the +pedagogy of the program/discipline and the needs of students.} +%\section[Patterns of scheduling]{Describe current patterns of scheduling (such as such as modality, class size, duration, times, location, or other). How do these relate to the pedagogy of the program/discipline and/or the needs of students?} %new version of the question, from Kendra +\label{facilities:sec:scheduling} +The math departments schedule classes that start as early as 7:00 {\sc a.m.}\ and +others that run as late as 9:50 {\sc p.m.} About 80\% of our math classes are offered +in a two-day-a week format, meeting either Monday-Wednesday or +Tuesday-Thursday. Some sections are offered in a three-day-a-week format and a +few in a four-day-a-week format; sections are offered in these formats to +accommodate students who find it helpful to be introduced to less content in +any one class session. + +We also schedule classes that meet only once a week; some of those classes are +scheduled on Saturdays. While once-weekly meetings are not an ideal format for +teaching mathematics, having such sections creates options for students who +cannot attend college more than one day a week. + +We offer several courses online, the enrollment in which has jumped +dramatically over the past five years (see \vref{fig:sec3:F2Fenrollments} and the discussion +surrounding it). We also offer classes in both a web/TV hybrid and an online/on-campus hybrid format. + +On-campus class sizes generally range from 20 to 35 students; that number is +typically dependent on the room that is assigned for the class (see \cpageref{needs:page:classsize} and +\vref{app:sec:classsize}). This has led +to some inconsistencies among campuses as distribution of classroom capacities +is not consistent from one campus to the next. + +Teaching online presents unique obstacles for faculty and students alike. +Faculty members, like students, have different methods of addressing these +obstacles. The SAC has a recommended capacity limit of twenty-five for each +section on its DL course offerings. This recommendation was based upon a +determination that twenty-five is a reasonable class size given the extra +duties associated with teaching online. Because the attrition rates in online +courses can be higher than that in on-campus courses, many DL instructors ask +that their class capacity be set at, say, thirty to accommodate for first week +attrition. + +In addition to increased class sizes that account for anticipated attrition, +some faculty members choose to allow additional students when their workload +allows for the attendant extra work. In fact, during Winter 2014, only fifteen +out of a total of forty-one DL sections are limited to twenty-five students. +Of the remaining DL sections, seven are capped between twenty-five and thirty, +twelve are capped in the mid-to-low thirties, and seven are capped at greater +than forty-five. Further information about scheduling patterns, broken down +by campus, can be found in \vref{sec:app:courseschedule}. + +There is no specific pedagogical dictates in most of our courses. Class +activities can range from lecture to class-discussion to group-work to +student-board-work. Some instructors provide their students with pre-printed +lecture notes and examples, others write notes on the board; some instructors +have their students work mostly on computer-based activities, and yet others +mostly work problems from the textbook. The frequency with which each +instructor uses each approach is almost entirely up to him/her. Many +instructors have a required online homework component, while others do not. + +This diversity of classroom experience has both positive and negative +consequences. On the positive side, it provides an environment that has the +potential to address a wide-range of learning styles. On the negative side, it +can lead to very inconsistent experiences for students as they work their way +through a sequence. The inconsistency is probably most prevalent and, +unfortunately, most problematic at the DE level of instruction. +As the Math SAC looks for ways to increase completion rates for students who +place into developmental mathematics courses, serious attention will be given +to plans that increase the consistency of classroom experience for students; +consistency that is built upon evidence-based best practices. + diff --git a/test-cases/oneSentencePerLine/pcc-program-review2-mod1.tex b/test-cases/oneSentencePerLine/pcc-program-review2-mod1.tex new file mode 100644 index 00000000..e383bb3c --- /dev/null +++ b/test-cases/oneSentencePerLine/pcc-program-review2-mod1.tex @@ -0,0 +1,234 @@ +% arara: pdflatex: {files: [MathSACpr2014]} +% !arara: indent: {overwrite: yes} +\chapter[Faculty composition and qualifications]{Faculty: reflect on the + composition, qualifications and development of the faculty} +\epigraph{ % + I want to tell you what went through my head as I saw the D on my \nth{3} exam in Calc II: ``f\#\$king a\&\$hole! + '' That D changed my life. + The feeling of failure, not from my incompetence but rather my laziness. + I want to let you know that every single success in my life now is due in part to your teachings. + I can't thank you enough \& I hope that if for nothing else, you have made a great influence on me. +}{PCC Mathematics + Student, December 2013} + +\section[Faculty composition]{Provide information on each of the following:} +\subsection[Quantity and quality of the faculty]{Quantity and quality of the faculty needed to meet the needs of the + program or discipline.} +The total number of full-time faculty at all campuses between 2011 and 2013 varied between 36 to 41 and the part-time faculty varied between 143 to 158 on any given term, not including Summer. +The percent of \emph{all} courses (pre-college and college level) taught by full-time instructors during this time period varied from a low of 22\% at Rock Creek to a high of 29\% at Sylvania (see \cref{app:tab:analysisPTFT}). + +From the academic year 2008/09 to 2012/13 there was a significant increase in the number of students taking math courses at all campuses as shown \cref{reflect:tab:enrollment}. +\begin{table}[!htb] + \centering + \caption{Enrollment Difference from AY 08/09 to AY 12/13} + \label{reflect:tab:enrollment} + \begin{tabular}{lrr} + \toprule + Campus & Enrollment Difference & \% increase \\ + \midrule + SY & 5277 & 48.59\% \\ + CA & 3666 & 64.82\% \\ + RC & 5333 & 55.87\% \\ + ELC & 3171 & 103.09\% \\ + \bottomrule + \end{tabular} +\end{table} + +\Cref{app:tab:analysisPTFT} summarizes the breakdown of courses taught by +full-time and part-time faculty from Summer 2011--Spring 2013; breakdowns +by \emph{term} are given in \vref{app:sec:analysisPTFT}. + +\begin{table}[!htb] + \centering + \caption{Summary of sections taught (by campus) from Summer 2011--Spring 2013} + \label{app:tab:analysisPTFT} + % summary + % summary + % summary + \pgfplotstableread[col sep=comma]{./data/sectionsTaughtPTFT/sectionsTaughtPTFT2011-2013.csv}\sectionsTaughtSummary + \pgfplotstabletypeset[sectionFTPT]{\sectionsTaughtSummary} +\end{table} + +In reference to ``quality of the faculty needed to meet the needs of the discipline,'' it is insufficient to look at degree or experience qualifications alone. +Even a short list of what we expect from our mathematics faculty would include, but not be limited to that she/he: \begin{itemize} \item possess an understanding of effective mathematics teaching methodologies and strategies, and be able to adjust in response to student needs; \item teach the course content as outlined in CCOGs and with the appropriate mathematical rigor; \item show genuine commitment to students' success; \item identify problems when students encounter difficulties learning; \item demonstrate an ongoing intellectual curiosity about the relationship between teaching and learning; \item manage classroom learning environments and effectively handle student discipline problems; \item demonstrate technological literacy needed in the teaching of mathematics; \item participate in professional organizations; \item develop, evaluate and revise the mathematics curricula; \item serve and contribute to the PCC community as a whole through campus and district wide committees and activities. +\end{itemize} +In addition, with the enormous enrollment increases of the past several years, there are more students than ever needing both remediation in mathematics and guidance in general about what it takes to be a successful college student. + +Addressing this section heading directly, the `quantity' of full-time faculty needed to achieve the `quality' goals noted above is currently inadequate. +It is primarily the full-time faculty that has the time, resources and institutional support to fully realize the expectations noted above. +Part-time faculty are dedicated, but the expectations are different given the many of the challenges they face (discussed below). +To increase the probability that a student moves successfully through our mathematics courses without sacrificing quality, having a larger full-time faculty presence than currently exists is needed. + +In recognizing the need for more full-time faculty, we do not want to downplay the skills and talents of our part-time faculty. +We have approximately 150 part-time instructors that serve our students each term, many of whom have teaching experience from other colleges and universities; they bring additional experiences from industry, other sciences, high school and middle school education, and so much more. +Since they teach such a high percentage of our classes, their success is crucial to our students' success. + +Given the importance of part-time faculty, efforts needs to be made to minimize the many challenges that are unique to them. +Many of these challenges are created by the fact that part-timers frequently work on more than one campus or have a second (or third) job beyond their work for PCC. +Many of the problems are created by the institution itself. +The challenges include limited office space, limited access to office computers and other resources, limited opportunities to attend meetings, limited opportunities to engage in professional development activities, limited opportunities for peer-to-peer discourse. + +\recommendation[Office of Academic and Student Affairs]{The college should + continue to add new full-time math positions so that at each campus full-timers + at least 40\% of all sections at both the DE and transfer level.} + +\recommendation[Math SAC, PCC Cabinet, ACCEPT, PCCFFAP]{Given the heavy + reliance on part-time faculty for staffing our courses, there is little chance + that we can institutionalize significant changes in our DE courses without an + empowered part-time work force. + As such, we recommend that the college take action to support professional development for part-time faculty, provide adequate office space and tools for part-time faculty, and any recommendations put forth by ACCEPT. +} + +\recommendation[PCC Cabinet, Human Resources]{The college should allow mathematics + departments, at the discretion of each campus's faculty, to hire full-time + faculty who meet the approved instructor qualifications for teaching at the + pre-100 level but not the approved instructor qualifications for teaching at + the post-100 level. + A large majority of our courses are at the DE level, and the needs of students enrolled in those courses are frequently different than the needs of students enrolled in undergraduate level courses. + Having a robust assortment of full-time faculty educational experience can only help in our pursuit of increased student success and completion. +} + +\subsection[Faculty turnover]{Extent of faculty turnover and changes anticipated in the next five + years.} +Since 2011, ten full-time instructors have been hired and seven full-time instructors have left campuses across the district (this includes full-time temporary positions). +Of the seven full-time instructors who left, five retired, one left to pursue other job opportunities, and one returned to another teaching job after her temporary full-time position terminated. +Three of the retirements occurred at Sylvania and one each at Rock Creek and Cascade. +In addition to those that left the college, four full-time instructors transferred from one campus to another. +Given no unexpected events, we anticipate that these demographics will roughly be repeated over the next five years. + +Since 2011, 53 part-time instructors have been hired and 35 part-time instructors have left campuses across the district. +Of the three campuses, Rock Creek has the most part-time faculty turnover, followed by Cascade and Sylvania. +Reasons for leaving varied, but at least eight of the part-time instructors who left campuses simply moved to another campus in the district (see \vref{app:sec:facultyDegrees}). + +\subsection[Part-time faculty]{Extent of the reliance upon part-time faculty and how they compare + with full-time faculty in terms of educational and experiential backgrounds.} +Across the district, the mathematics departments rely heavily upon part-time faculty to teach the majority of the math classes offered. +Between 2011 and 2013, 75. +1\% of the classes at Cascade were taught by part-time instructors, +71.8\% at Rock Creek, 72.7\% at Southeast, and 59\% at Sylvania. +This reliance on part-time faculty to teach classes has been a challenge to the departments in a number of ways: \begin{itemize} \item the turnover of part-time faculty is higher and thus there is a need to orient new employees more frequently and provide mentoring and guidance to them as well; \item many part-time faculty are on campus only to teach their courses, and thus often do not attend meetings and keep up with current SAC discussions on curriculum. +\end{itemize} +For these reasons, classes have a higher probability to be taught with less consistency than the mathematics SAC would like. +Increasing the number of full-time faculty (and thus decreasing the dependence on part-time faculty) would mitigate much of this inconsistency; complete details are given in \vref{app:sec:analysisPTFT}. + +Part-time faculty educational backgrounds vary much more than the full-time faculty backgrounds. +Full-time instructors have master's or doctorate degrees in mathematics or related fields with extensive math graduate credits. +About a quarter of the part-time instructors have bachelor's degrees and the rest have either a master's or doctorate degree. +The part-time instructors come from a variety of employment backgrounds and have different reasons for working part-time. +They may be high school instructors (active or retired), may come from a household in which only one member is working full time while the other teaches part time, may be recently graduated MS or MAT students seeking full time employment, may be working full time elsewhere in a non-educational field, or may be retired from a non-educational field (see \vref{app:sec:facultyDegrees}). +% Is it true that a quarter of our PT faculty only have BS degrees? How did +% this happen? I don't see room for that in the IQs. How did you get this +% data? + +\subsection[Faculty diversity]{How the faculty composition reflects the diversity and cultural + competency goals of the institution.} +The mathematics SAC is deeply committed to fostering an inclusive campus climate at each location that respects all individuals regardless of race, color, religion, ethnicity, use of native language, national origin, sex, marital status, height/weight ratio, disability, veteran status, age, or sexual orientation. +Many of these human characteristics noted above are not measurable nor necessarily discernible. +However, PCC does gather data on gender and race/ethnicity, as detailed in \cref{reflect:tab:racialethnicmakeup} (see also the extensive demographic data displayed in \vref{app:sec:demographicdata}). + +\begin{table}[!htb] + \centering + \caption{Racial/Ethnic Make-up of PCC Faculty and Students} + \label{reflect:tab:racialethnicmakeup} + \begin{tabular}{rrrr} + \toprule + & PT Faculty & FT Faculty & Students \\ + \midrule + Male & 54.1\% & 53.2\% & 55\% \\ + Female & 45.9\% & 47\% & 45\% \\ + Asian /Pacific Islander & 7.7\% & 6.4\% & 8\% \\ + Black or African American & 1.1\% & 0.0\% & 6\% \\ + Hispanic/Latino & 2.2\% & 4.3\% & 11\% \\ + Multiracial & 1.1\% & 0.0\% & 3\% \\ + Native American & 0.0\% & 0.0\% & 1\% \\ + Unknown/International & 12.2\% & 4.3\% & 3\% \\ + Caucasian & 75.7\% & 85.1\% & 68\% \\ + \bottomrule + \end{tabular} +\end{table} + +Our SAC will continue to strive toward keeping our faculty body ethnically diverse and culturally competent, but it is an area where improvement is needed. +In terms of hiring, there is a shortage of minorities in the Science, Technology, Engineering and Mathematics (STEM) undergraduate and graduate programs, which makes our recruitment of minority faculty difficult. +\label{reflect:page:stem} + +\recommendation[Math SAC, Division Deans]{Math chairs and deans should + strongly recommend that full- and part-time faculty + attend workshops related to diversity and cultural competency issues.} + +\recommendation[PCCFFAP, Division Deans]{Part-time faculty should be allowed + to attend diversity/cultural awareness workshops in lieu of contractually + mandated quarterly meetings.} + +\recommendation[Math SAC, Division Deans, Human Resources]{Hiring committees need to work with HR to identify + and aggressively target mathematics graduate programs in the Northwest with + minority students who are seeking teaching positions in community colleges.} + +\recommendation[Division Deans, Faculty Department Chairs]{Departments on all campuses should increase efforts to find candidates + for the Faculty Diversity Internship Program \cite{affirmativeaction}.} + +\section[Changes to instructor qualifications]{Report any changes the SAC has + made to instructor qualifications since + the last review and the reason for the changes.} +In Spring 2011, prompted by the transfer of MTH 20 from Developmental Education (DE) to the Mathematics SAC, the math instructor qualifications were changed. +MTH 20 had been the only remaining mathematics course in the DE SAC. + +The transfer included transitioning three full-time DE math instructors at Sylvania into the Math Department at Sylvania. +At this time, instructor qualifications for math faculty were examined and changed to reflect the inclusion of DE math faculty. +It was determined that separate qualifications should be written for pre-college and college level courses. +These qualifications were written so that all of the full-time DE math faculty transitioning into the math department (as well as any new DE math faculty hired) were qualified to teach the pre-college level courses and any new math faculty were qualified to teach all of the math courses. + +For instance, a masters degree in mathematics education (instead of just mathematics) was included as an optional qualification for full-time instructors teaching pre-college level courses. +Also a masters degree in mathematics education became an option for part-time instructors teaching MTH 211--213 (the sequence for elementary education math teachers). +Additionally, at the request of the administration, the terms `part-time' and `full-time' were removed from instructor qualifications in order to satisfy accreditation requirements. +Instead of labeling what had traditionally been part-time qualifications as `part-time,' these qualifications were labeled `Criteria for Provisional Instructors. +' + +In Winter 2013, the math instructor qualifications were again changed at the request of the math department chairs. +The `provisional' labeling from the last revision had required math department chairs to regularly re-certify part-time (`provisional') instructors. +In order to avoid this unnecessary paperwork, the SAC adopted a three-tiered qualification structure based on full-time, part-time, and provisionally-approved part-time instructors (mainly graduate students currently working on graduate degrees). +The part-time (non-provisional) tier was labeled `Demonstrated Competency. +' +Complete details of instructor qualifications are given in \vref{app:sec:instructorquals}. + +\section[Professional development activities]{How have professional development + activities of the faculty contributed to the strength of the + program/discipline? + If such activities have resulted in instructional or curricular changes, please describe. + } + +The members of the mathematics SAC, full-time and part-time alike, are very committed to professional development. +As with members of any academic discipline, the faculty in the Math SAC pursue professional development in a variety of manners. +Traditionally these activities have been categorized in ways such as `membership in professional organizations' or `presentations at conferences'. +The members of the Math SAC do not in any way devalue the engagement in such organizations or activities, and in fact a summative list of such things can be found in \vref{app:sec:memberships}. + +Nor do the members in any way diminish individual pursuit of professional development. +In an attempt to acknowledge such pursuits, each member of the full-time faculty was asked to submit one or two highlights of their professional development activities over the past five years. +Those submissions can be found in \vref{app:sec:professionaldevelop}. + +It should be noted that the list of organizations and activities found in these appendices are not exhaustive; they are merely a representative sample of the types of professional development pursuits engaged in by members of the Math SAC. + +The members of the Math SAC realize that if there is going to be institutional-level change that results in increased success and completion rates for students enrolled in DE mathematics courses, there are going to have to be targeted and on-going professional development activities with that goal in mind and that all mathematics faculty, full-time and part-time, are going to have to take advantage of those opportunities. +This is especially important since many of our faculty members are not specialists in working with developmental mathematics students. +We look forward to working with the broader PCC community as we pursue our common goal of increased student success and completion, and we look forward to the college's support in providing professional development opportunities that promote attainment of this goal. + +\recommendation[PCC Cabinet]{The college should provide funds and other necessary resources + that allow the SAC members to engage in targeted, on-going professional + development geared toward realization of district-wide goals. + This should include, for example, support for activities such as annual two-day workshops focusing on goals such as universal adoption of evidence-based best practices. +} + +\recommendation[Division Deans, Faculty Department Chairs, PCCFFAP, Completion Investment Council]{Each math department should create structures and policies that + promote sustained professional development. + Institutionalization of practices such as faculty-inquiry-groups and peer-to-peer classroom visitations are necessary components of sustained professional development. +} + +\recommendation[Math SAC, PCC Cabinet]{The college should continue to provide funds for activities + such as conference attendance, professional organization membership, etc. + At the same time, procedures should be put into place that allow for maximal dissemination of ``good ideas'' and maximum probability that said ideas grow into sustained practices. +} + +\recommendation[Division Deans, Faculty Department Chairs, PCCFFAP]{Formalized procedures for mentoring new faculty, full-time and + part-time alike, should be adopted and strictly observed. + Beginning a new job is a unique opportunity for rapid professional development, and we need to make sure that we provide as supportive and directed an opportunity for new faculty as possible so that the development happens in a positive and long-lasting way. +} + diff --git a/test-cases/oneSentencePerLine/pcc-program-review2-mod2.tex b/test-cases/oneSentencePerLine/pcc-program-review2-mod2.tex new file mode 100644 index 00000000..5ea1173f --- /dev/null +++ b/test-cases/oneSentencePerLine/pcc-program-review2-mod2.tex @@ -0,0 +1,227 @@ +% arara: pdflatex: {files: [MathSACpr2014]} +% !arara: indent: {overwrite: yes} +\chapter[Faculty composition and qualifications]{Faculty: reflect on the + composition, qualifications and development of the faculty} +\epigraph{ % + I want to tell you what went through my head as I saw the D on my \nth{3} exam in Calc II: ``f\#\$king a\&\$hole! + '' That D changed my life. + The feeling of failure, not from my incompetence but rather my laziness. + I want to let you know that every single success in my life now is due in part to your teachings. + I can't thank you enough \& I hope that if for nothing else, you have made a great influence on me.}{PCC Mathematics Student, December 2013} + +\section[Faculty composition]{Provide information on each of the following:} \subsection[Quantity and quality of the faculty]{Quantity and quality of the faculty needed to meet the needs of the program or discipline.} The total number of full-time faculty at all campuses between 2011 and 2013 varied between 36 to 41 and the part-time faculty varied between 143 to 158 on any given term, not including Summer. +The percent of \emph{all} courses (pre-college and college level) taught by full-time instructors during this time period varied from a low of 22\% at Rock Creek to a high of 29\% at Sylvania (see \cref{app:tab:analysisPTFT}). + +From the academic year 2008/09 to 2012/13 there was a significant increase in the number of students taking math courses at all campuses as shown \cref{reflect:tab:enrollment}. +\begin{table}[!htb] + \centering + \caption{Enrollment Difference from AY 08/09 to AY 12/13} + \label{reflect:tab:enrollment} + \begin{tabular}{lrr} + \toprule + Campus & Enrollment Difference & \% increase \\ + \midrule + SY & 5277 & 48.59\% \\ + CA & 3666 & 64.82\% \\ + RC & 5333 & 55.87\% \\ + ELC & 3171 & 103.09\% \\ + \bottomrule + \end{tabular} +\end{table} + +\Cref{app:tab:analysisPTFT} summarizes the breakdown of courses taught by full-time and part-time faculty from Summer 2011--Spring 2013; breakdowns by \emph{term} are given in \vref{app:sec:analysisPTFT}. + +\begin{table}[!htb] + \centering + \caption{Summary of sections taught (by campus) from Summer 2011--Spring 2013} + \label{app:tab:analysisPTFT} + % summary + % summary + % summary + \pgfplotstableread[col sep=comma]{./data/sectionsTaughtPTFT/sectionsTaughtPTFT2011-2013.csv}\sectionsTaughtSummary + \pgfplotstabletypeset[sectionFTPT]{\sectionsTaughtSummary} +\end{table} + +In reference to ``quality of the faculty needed to meet the needs of the discipline,'' it is insufficient to look at degree or experience qualifications alone. +Even a short list of what we expect from our mathematics faculty would include, but not be limited to that she/he: +\begin{itemize} + \item possess an understanding of effective mathematics teaching methodologies and strategies, and be able to adjust in response to student needs; + \item teach the course content as outlined in CCOGs and with the appropriate mathematical rigor; + \item show genuine commitment to students' success; + \item identify problems when students encounter difficulties learning; + \item demonstrate an ongoing intellectual curiosity about the relationship between teaching and learning; + \item manage classroom learning environments and effectively handle student discipline problems; + \item demonstrate technological literacy needed in the teaching of mathematics; + \item participate in professional organizations; + \item develop, evaluate and revise the mathematics curricula; + \item serve and contribute to the PCC community as a whole through campus and district wide committees and activities. +\end{itemize} +In addition, with the enormous enrollment increases of the past several years, there are more students than ever needing both remediation in mathematics and guidance in general about what it takes to be a successful college student. + +Addressing this section heading directly, the `quantity' of full-time faculty needed to achieve the `quality' goals noted above is currently inadequate. +It is primarily the full-time faculty that has the time, resources and institutional support to fully realize the expectations noted above. +Part-time faculty are dedicated, but the expectations are different given the many of the challenges they face (discussed below). +To increase the probability that a student moves successfully through our mathematics courses without sacrificing quality, having a larger full-time faculty presence than currently exists is needed. + +In recognizing the need for more full-time faculty, we do not want to downplay the skills and talents of our part-time faculty. +We have approximately 150 part-time instructors that serve our students each term, many of whom have teaching experience from other colleges and universities; they bring additional experiences from industry, other sciences, high school and middle school education, and so much more. +Since they teach such a high percentage of our classes, their success is crucial to our students' success. + +Given the importance of part-time faculty, efforts needs to be made to minimize the many challenges that are unique to them. +Many of these challenges are created by the fact that part-timers frequently work on more than one campus or have a second (or third) job beyond their work for PCC. +Many of the problems are created by the institution itself. +The challenges include limited office space, limited access to office computers and other resources, limited opportunities to attend meetings, limited opportunities to engage in professional development activities, limited opportunities for peer-to-peer discourse. + +\recommendation[Office of Academic and Student Affairs]{The college should + continue to add new full-time math positions so that at each campus full-timers + at least 40\% of all sections at both the DE and transfer level.} + +\recommendation[Math SAC, PCC Cabinet, ACCEPT, PCCFFAP]{Given the heavy + reliance on part-time faculty for staffing our courses, there is little chance + that we can institutionalize significant changes in our DE courses without an + empowered part-time work force. + As such, we recommend that the college take action to support professional development for part-time faculty, provide adequate office space and tools for part-time faculty, and any recommendations put forth by ACCEPT.} + +\recommendation[PCC Cabinet, Human Resources]{The college should allow mathematics departments, at the discretion of each campus's faculty, to hire full-time faculty who meet the approved instructor qualifications for teaching at the pre-100 level but not the approved instructor qualifications for teaching at the post-100 level. + A large majority of our courses are at the DE level, and the needs of students enrolled in those courses are frequently different than the needs of students enrolled in undergraduate level courses. + Having a robust assortment of full-time faculty educational experience can only help in our pursuit of increased student success and completion.} + +\subsection[Faculty turnover]{Extent of faculty turnover and changes anticipated in the next five years.} Since 2011, ten full-time instructors have been hired and seven full-time instructors have left campuses across the district (this includes full-time temporary positions). +Of the seven full-time instructors who left, five retired, one left to pursue other job opportunities, and one returned to another teaching job after her temporary full-time position terminated. +Three of the retirements occurred at Sylvania and one each at Rock Creek and Cascade. +In addition to those that left the college, four full-time instructors transferred from one campus to another. +Given no unexpected events, we anticipate that these demographics will roughly be repeated over the next five years. + +Since 2011, 53 part-time instructors have been hired and 35 part-time instructors have left campuses across the district. +Of the three campuses, Rock Creek has the most part-time faculty turnover, followed by Cascade and Sylvania. +Reasons for leaving varied, but at least eight of the part-time instructors who left campuses simply moved to another campus in the district (see \vref{app:sec:facultyDegrees}). + +\subsection[Part-time faculty]{Extent of the reliance upon part-time faculty and how they compare + with full-time faculty in terms of educational and experiential backgrounds.} +Across the district, the mathematics departments rely heavily upon part-time faculty to teach the majority of the math classes offered. +Between 2011 and 2013, 75.1\% of the classes at Cascade were taught by part-time instructors, 71.8\% at Rock Creek, 72.7\% at Southeast, and 59\% at Sylvania. +This reliance on part-time faculty to teach classes has been a challenge to the departments in a number of ways: +\begin{itemize} + \item the turnover of part-time faculty is higher and thus there is a need to orient new employees more frequently and provide mentoring and guidance to them as well; + \item many part-time faculty are on campus only to teach their courses, and thus often do not attend meetings and keep up with current SAC discussions on curriculum. +\end{itemize} +For these reasons, classes have a higher probability to be taught with less consistency than the mathematics SAC would like. +Increasing the number of full-time faculty (and thus decreasing the dependence on part-time faculty) would mitigate much of this inconsistency; complete details are given in \vref{app:sec:analysisPTFT}. + +Part-time faculty educational backgrounds vary much more than the full-time faculty backgrounds. +Full-time instructors have master's or doctorate degrees in mathematics or related fields with extensive math graduate credits. +About a quarter of the part-time instructors have bachelor's degrees and the rest have either a master's or doctorate degree. +The part-time instructors come from a variety of employment backgrounds and have different reasons for working part-time. +They may be high school instructors (active or retired), may come from a household in which only one member is working full time while the other teaches part time, may be recently graduated MS or MAT students seeking full time employment, may be working full time elsewhere in a non-educational field, or may be retired from a non-educational field (see \vref{app:sec:facultyDegrees}). +% Is it true that a quarter of our PT faculty only have BS degrees? How did +% this happen? I don't see room for that in the IQs. How did you get this +% data? + +\subsection[Faculty diversity]{How the faculty composition reflects the diversity and cultural + competency goals of the institution.} +The mathematics SAC is deeply committed to fostering an inclusive campus climate at each location that respects all individuals regardless of race, color, religion, ethnicity, use of native language, national origin, sex, marital status, height/weight ratio, disability, veteran status, age, or sexual orientation. +Many of these human characteristics noted above are not measurable nor necessarily discernible. +However, PCC does gather data on gender and race/ethnicity, as detailed in \cref{reflect:tab:racialethnicmakeup} (see also the extensive demographic data displayed in \vref{app:sec:demographicdata}). + +\begin{table}[!htb] + \centering + \caption{Racial/Ethnic Make-up of PCC Faculty and Students} + \label{reflect:tab:racialethnicmakeup} + \begin{tabular}{rrrr} + \toprule + & PT Faculty & FT Faculty & Students \\ + \midrule + Male & 54.1\% & 53.2\% & 55\% \\ + Female & 45.9\% & 47\% & 45\% \\ + Asian /Pacific Islander & 7.7\% & 6.4\% & 8\% \\ + Black or African American & 1.1\% & 0.0\% & 6\% \\ + Hispanic/Latino & 2.2\% & 4.3\% & 11\% \\ + Multiracial & 1.1\% & 0.0\% & 3\% \\ + Native American & 0.0\% & 0.0\% & 1\% \\ + Unknown/International & 12.2\% & 4.3\% & 3\% \\ + Caucasian & 75.7\% & 85.1\% & 68\% \\ + \bottomrule + \end{tabular} +\end{table} + +Our SAC will continue to strive toward keeping our faculty body ethnically diverse and culturally competent, but it is an area where improvement is needed. +In terms of hiring, there is a shortage of minorities in the Science, Technology, Engineering and Mathematics (STEM) undergraduate and graduate programs, which makes our recruitment of minority faculty difficult. +\label{reflect:page:stem} + +\recommendation[Math SAC, Division Deans]{Math chairs and deans should + strongly recommend that full- and part-time faculty + attend workshops related to diversity and cultural competency issues.} + +\recommendation[PCCFFAP, Division Deans]{Part-time faculty should be allowed + to attend diversity/cultural awareness workshops in lieu of contractually + mandated quarterly meetings.} + +\recommendation[Math SAC, Division Deans, Human Resources]{Hiring committees need to work with HR to identify + and aggressively target mathematics graduate programs in the Northwest with + minority students who are seeking teaching positions in community colleges.} + +\recommendation[Division Deans, Faculty Department Chairs]{Departments on all campuses should increase efforts to find candidates + for the Faculty Diversity Internship Program \cite{affirmativeaction}.} + +\section[Changes to instructor qualifications]{Report any changes the SAC has + made to instructor qualifications since + the last review and the reason for the changes.} +In Spring 2011, prompted by the transfer of MTH 20 from Developmental Education (DE) to the Mathematics SAC, the math instructor qualifications were changed. +MTH 20 had been the only remaining mathematics course in the DE SAC. + +The transfer included transitioning three full-time DE math instructors at Sylvania into the Math Department at Sylvania. +At this time, instructor qualifications for math faculty were examined and changed to reflect the inclusion of DE math faculty. +It was determined that separate qualifications should be written for pre-college and college level courses. +These qualifications were written so that all of the full-time DE math faculty transitioning into the math department (as well as any new DE math faculty hired) were qualified to teach the pre-college level courses and any new math faculty were qualified to teach all of the math courses. + +For instance, a masters degree in mathematics education (instead of just mathematics) was included as an optional qualification for full-time instructors teaching pre-college level courses. +Also a masters degree in mathematics education became an option for part-time instructors teaching MTH 211--213 (the sequence for elementary education math teachers). +Additionally, at the request of the administration, the terms `part-time' and `full-time' were removed from instructor qualifications in order to satisfy accreditation requirements. +Instead of labeling what had traditionally been part-time qualifications as `part-time,' these qualifications were labeled `Criteria for Provisional Instructors. +' + +In Winter 2013, the math instructor qualifications were again changed at the request of the math department chairs. +The `provisional' labeling from the last revision had required math department chairs to regularly re-certify part-time (`provisional') instructors. +In order to avoid this unnecessary paperwork, the SAC adopted a three-tiered qualification structure based on full-time, part-time, and provisionally-approved part-time instructors (mainly graduate students currently working on graduate degrees). +The part-time (non-provisional) tier was labeled `Demonstrated Competency. +' +Complete details of instructor qualifications are given in \vref{app:sec:instructorquals}. + +\section[Professional development activities]{How have professional development + activities of the faculty contributed to the strength of the + program/discipline? + If such activities have resulted in instructional or curricular changes, please describe.} + +The members of the mathematics SAC, full-time and part-time alike, are very committed to professional development. +As with members of any academic discipline, the faculty in the Math SAC pursue professional development in a variety of manners. +Traditionally these activities have been categorized in ways such as `membership in professional organizations' or `presentations at conferences'. +The members of the Math SAC do not in any way devalue the engagement in such organizations or activities, and in fact a summative list of such things can be found in \vref{app:sec:memberships}. + +Nor do the members in any way diminish individual pursuit of professional development. +In an attempt to acknowledge such pursuits, each member of the full-time faculty was asked to submit one or two highlights of their professional development activities over the past five years. +Those submissions can be found in \vref{app:sec:professionaldevelop}. + +It should be noted that the list of organizations and activities found in these appendices are not exhaustive; they are merely a representative sample of the types of professional development pursuits engaged in by members of the Math SAC. + +The members of the Math SAC realize that if there is going to be institutional-level change that results in increased success and completion rates for students enrolled in DE mathematics courses, there are going to have to be targeted and on-going professional development activities with that goal in mind and that all mathematics faculty, full-time and part-time, are going to have to take advantage of those opportunities. +This is especially important since many of our faculty members are not specialists in working with developmental mathematics students. +We look forward to working with the broader PCC community as we pursue our common goal of increased student success and completion, and we look forward to the college's support in providing professional development opportunities that promote attainment of this goal. + +\recommendation[PCC Cabinet]{The college should provide funds and other necessary resources + that allow the SAC members to engage in targeted, on-going professional + development geared toward realization of district-wide goals. + This should include, for example, support for activities such as annual two-day workshops focusing on goals such as universal adoption of evidence-based best practices.} + +\recommendation[Division Deans, Faculty Department Chairs, PCCFFAP, Completion Investment Council]{Each math department should create structures and policies that promote sustained professional development. + Institutionalization of practices such as faculty-inquiry-groups and peer-to-peer classroom visitations are necessary components of sustained professional development.} + +\recommendation[Math SAC, PCC Cabinet]{The college should continue to provide funds for activities such as conference attendance, professional organization membership, etc. + At the same time, procedures should be put into place that allow for maximal dissemination of ``good ideas'' and maximum probability that said ideas grow into sustained practices.} + +\recommendation[Division Deans, Faculty Department Chairs, PCCFFAP]{Formalized procedures for mentoring new faculty, full-time and part-time alike, should be adopted and strictly observed. + Beginning a new job + is a unique opportunity for rapid professional development, and we need to make + sure that we provide as supportive and directed an opportunity for new faculty + as possible so that the development happens in a positive and long-lasting + way.} + diff --git a/test-cases/oneSentencePerLine/pcc-program-review2.tex b/test-cases/oneSentencePerLine/pcc-program-review2.tex new file mode 100644 index 00000000..84ccdb7b --- /dev/null +++ b/test-cases/oneSentencePerLine/pcc-program-review2.tex @@ -0,0 +1,347 @@ +% arara: pdflatex: {files: [MathSACpr2014]} +% !arara: indent: {overwrite: yes} +\chapter[Faculty composition and qualifications]{Faculty: reflect on the +composition, qualifications and development of the faculty} +\epigraph{ % + I want to tell you what went through my head as I saw the D on my \nth{3} exam in + Calc II: ``f\#\$king a\&\$hole!'' That D changed my life. The feeling of + failure, not from my incompetence but rather my laziness. + I want to let you know that every single success in my life now is due in part + to your teachings. I can't thank you enough \& I hope that if for nothing + else, you have made a great influence on me.}{PCC Mathematics +Student, December 2013} + +\section[Faculty composition]{Provide information on each of the following:} +\subsection[Quantity and quality of the faculty]{Quantity and quality of the faculty needed to meet the needs of the +program or discipline.} +The total number of full-time faculty at all campuses between 2011 and 2013 +varied between 36 to 41 and the +part-time faculty varied between 143 to 158 on any given term, not including +Summer. The percent of \emph{all} courses (pre-college and college level) +taught by full-time instructors during this time period varied from a low of +22\% at Rock Creek to a high of 29\% at Sylvania (see +\cref{app:tab:analysisPTFT}). + +From the academic year 2008/09 to 2012/13 there was a significant increase in the +number of students taking math courses at all campuses as shown +\cref{reflect:tab:enrollment}. +\begin{table}[!htb] + \centering + \caption{Enrollment Difference from AY 08/09 to AY 12/13} + \label{reflect:tab:enrollment} + \begin{tabular}{lrr} + \toprule + Campus & Enrollment Difference & \% increase \\ + \midrule + SY & 5277 & 48.59\% \\ + CA & 3666 & 64.82\% \\ + RC & 5333 & 55.87\% \\ + ELC & 3171 & 103.09\% \\ + \bottomrule + \end{tabular} +\end{table} + +\Cref{app:tab:analysisPTFT} summarizes the breakdown of courses taught by +full-time and part-time faculty from Summer 2011--Spring 2013; breakdowns +by \emph{term} are given in \vref{app:sec:analysisPTFT}. + +\begin{table}[!htb] + \centering + \caption{Summary of sections taught (by campus) from Summer 2011--Spring 2013} + \label{app:tab:analysisPTFT} + % summary + % summary + % summary + \pgfplotstableread[col sep=comma]{./data/sectionsTaughtPTFT/sectionsTaughtPTFT2011-2013.csv}\sectionsTaughtSummary + \pgfplotstabletypeset[sectionFTPT]{\sectionsTaughtSummary} +\end{table} + + +In reference to ``quality of the faculty needed to meet the needs of the +discipline,'' it is insufficient to look at degree or experience +qualifications alone. Even a short list of what we expect from our mathematics +faculty would include, but not be limited to that she/he: +\begin{itemize} + \item possess an understanding of effective mathematics teaching + methodologies and strategies, and be able to adjust in response to + student needs; + \item teach the course content as outlined in CCOGs and with the appropriate mathematical rigor; + \item show genuine commitment to students' success; + \item identify problems when students encounter difficulties learning; + \item demonstrate an ongoing intellectual curiosity about the relationship + between teaching and learning; + \item manage classroom learning environments and effectively handle student + discipline problems; + \item demonstrate technological literacy needed in the teaching of mathematics; + \item participate in professional organizations; + \item develop, evaluate and revise the mathematics curricula; + \item serve and contribute to the PCC community as a whole through campus and + district wide committees and activities. +\end{itemize} +In addition, with the enormous enrollment increases of the past several years, +there are more students than ever needing both remediation in mathematics and +guidance in general about what it takes to be a successful college student. + +Addressing this section heading directly, the `quantity' of full-time faculty +needed to achieve the `quality' goals noted above is currently inadequate. It +is primarily the full-time faculty that has the time, resources and +institutional support to fully realize the expectations noted above. Part-time +faculty are dedicated, but the expectations are different given the +many of the challenges they face (discussed below). To increase the probability that a student moves successfully +through our mathematics courses without sacrificing quality, having a larger +full-time faculty presence than currently exists is needed. + +In recognizing the need for more full-time faculty, we do not want to downplay +the skills and talents of our part-time faculty. We have approximately 150 +part-time instructors that serve our students each term, many of whom have +teaching experience from other colleges and universities; they bring additional +experiences from industry, other sciences, high school and middle school +education, and so much more. Since they teach such a high percentage of our +classes, their success is crucial to our students' success. + +Given the importance of part-time faculty, efforts needs to be made to minimize +the many challenges that are unique to them. Many of these challenges are +created by the fact that part-timers frequently work on more than one campus or +have a second (or third) job beyond their work for PCC. Many of the problems +are created by the institution itself. The challenges include limited office +space, limited access to office computers and other resources, limited +opportunities to attend meetings, limited opportunities to engage in +professional development activities, limited opportunities for peer-to-peer +discourse. + +\recommendation[Office of Academic and Student Affairs]{The college should + continue to add new full-time math positions so that at each campus full-timers + at least 40\% of all sections at both the DE and transfer level.} + +\recommendation[Math SAC, PCC Cabinet, ACCEPT, PCCFFAP]{Given the heavy + reliance on part-time faculty for staffing our courses, there is little chance + that we can institutionalize significant changes in our DE courses without an + empowered part-time work force. As such, we recommend that the college take + action to support professional development for part-time faculty, provide + adequate office space and tools for part-time faculty, and any recommendations +put forth by ACCEPT.} + +\recommendation[PCC Cabinet, Human Resources]{The college should allow mathematics + departments, at the discretion of each campus's faculty, to hire full-time + faculty who meet the approved instructor qualifications for teaching at the + pre-100 level but not the approved instructor qualifications for teaching at + the post-100 level. A large majority of our courses are at the DE level, and + the needs of students enrolled in those courses are frequently different than + the needs of students enrolled in undergraduate level courses. Having a robust + assortment of full-time faculty educational experience can only help in our +pursuit of increased student success and completion.} + + +\subsection[Faculty turnover]{Extent of faculty turnover and changes anticipated in the next five +years.} +Since 2011, ten full-time instructors have been hired and seven full-time +instructors have left campuses across the district (this includes full-time +temporary positions). Of the seven full-time +instructors who left, five retired, one left to pursue other job opportunities, +and one returned to another teaching job after her temporary full-time position +terminated. Three of the retirements occurred at Sylvania and one each at Rock +Creek and Cascade. In addition to those that left the college, four full-time +instructors transferred from one campus to another. Given no unexpected +events, we anticipate that these demographics will roughly be repeated over the +next five years. + + +Since 2011, 53 part-time instructors have been hired and 35 part-time +instructors have left campuses across the district. Of the three campuses, +Rock Creek has the most part-time faculty turnover, followed by Cascade and +Sylvania. Reasons for leaving varied, but at least eight of the part-time +instructors who left campuses simply moved to another campus in the district +(see \vref{app:sec:facultyDegrees}). + +\subsection[Part-time faculty]{Extent of the reliance upon part-time faculty and how they compare +with full-time faculty in terms of educational and experiential backgrounds.} +Across the district, the mathematics departments rely heavily upon part-time +faculty to teach the majority of the math classes offered. Between 2011 and +2013, 75.1\% of the classes at Cascade were taught by part-time instructors, +71.8\% at Rock Creek, 72.7\% at Southeast, and 59\% at Sylvania. This reliance +on part-time faculty to teach classes has been a challenge to the departments +in a number of ways: +\begin{itemize} + \item the turnover of part-time faculty is higher and + thus there is a need to orient new employees more frequently and provide + mentoring and guidance to them as well; + \item many part-time faculty are on + campus only to teach their courses, and thus often do not attend meetings and + keep up with current SAC discussions on curriculum. +\end{itemize} +For these reasons, classes have a higher probability to be taught with less consistency than the +mathematics SAC would like. Increasing the number of full-time faculty (and +thus decreasing the dependence on part-time faculty) would mitigate much of +this inconsistency; complete details are given in \vref{app:sec:analysisPTFT}. + +Part-time faculty educational backgrounds vary much more than the full-time +faculty backgrounds. Full-time instructors have master's or doctorate degrees +in mathematics or related fields with extensive math graduate credits. About a +quarter of the part-time instructors have bachelor's degrees and the rest have +either a master's or doctorate degree. The part-time instructors come from a +variety of employment backgrounds and have different reasons for working +part-time. They may be high school instructors (active or retired), may come +from a household in which only one member is working full time while the other +teaches part time, may be recently graduated MS or MAT students seeking full +time employment, may be working full time elsewhere in a non-educational field, +or may be retired from a non-educational field (see +\vref{app:sec:facultyDegrees}). +% Is it true that a quarter of our PT faculty only have BS degrees? How did +% this happen? I don't see room for that in the IQs. How did you get this +% data? + +\subsection[Faculty diversity]{How the faculty composition reflects the diversity and cultural +competency goals of the institution.} +The mathematics SAC is deeply committed to fostering an inclusive campus +climate at each location that respects all individuals regardless of race, +color, religion, ethnicity, use of native language, national origin, sex, +marital status, height/weight ratio, disability, veteran status, age, or sexual +orientation. Many of these human characteristics noted above are not +measurable nor necessarily discernible. However, PCC does gather data on +gender and race/ethnicity, as detailed in \cref{reflect:tab:racialethnicmakeup} +(see also the extensive demographic data displayed in +\vref{app:sec:demographicdata}). + +\begin{table}[!htb] + \centering + \caption{Racial/Ethnic Make-up of PCC Faculty and Students} + \label{reflect:tab:racialethnicmakeup} + \begin{tabular}{rrrr} + \toprule + & PT Faculty & FT Faculty & Students \\ + \midrule + Male & 54.1\% & 53.2\% & 55\% \\ + Female & 45.9\% & 47\% & 45\% \\ + Asian /Pacific Islander & 7.7\% & 6.4\% & 8\% \\ + Black or African American & 1.1\% & 0.0\% & 6\% \\ + Hispanic/Latino & 2.2\% & 4.3\% & 11\% \\ + Multiracial & 1.1\% & 0.0\% & 3\% \\ + Native American & 0.0\% & 0.0\% & 1\% \\ + Unknown/International & 12.2\% & 4.3\% & 3\% \\ + Caucasian & 75.7\% & 85.1\% & 68\% \\ + \bottomrule + \end{tabular} +\end{table} + +Our SAC will continue to strive toward keeping our faculty body ethnically +diverse and culturally competent, but it is an area where improvement is +needed. In terms of hiring, there is a shortage of minorities in the Science, Technology, Engineering +and Mathematics (STEM) undergraduate and graduate programs, which makes our +recruitment of minority faculty difficult. \label{reflect:page:stem} + +\recommendation[Math SAC, Division Deans]{Math chairs and deans should + strongly recommend that full- and part-time faculty +attend workshops related to diversity and cultural competency issues.} + +\recommendation[PCCFFAP, Division Deans]{Part-time faculty should be allowed + to attend diversity/cultural awareness workshops in lieu of contractually +mandated quarterly meetings.} + +\recommendation[Math SAC, Division Deans, Human Resources]{Hiring committees need to work with HR to identify + and aggressively target mathematics graduate programs in the Northwest with +minority students who are seeking teaching positions in community colleges.} + +\recommendation[Division Deans, Faculty Department Chairs]{Departments on all campuses should increase efforts to find candidates + for the Faculty Diversity Internship Program \cite{affirmativeaction}.} + +\section[Changes to instructor qualifications]{Report any changes the SAC has + made to instructor qualifications since +the last review and the reason for the changes.} +In Spring 2011, prompted by the transfer of MTH 20 from Developmental +Education (DE) to the Mathematics SAC, the math instructor qualifications were +changed. MTH 20 had been the only remaining mathematics course in the DE SAC. + +The transfer included transitioning three full-time DE math instructors at +Sylvania into the Math Department at Sylvania. At this time, instructor +qualifications for math faculty were examined and changed to reflect the +inclusion of DE math faculty. It was determined that separate qualifications +should be written for pre-college and college level courses. These +qualifications were written so that all of the full-time DE math faculty +transitioning into the math department (as well as any new DE math faculty +hired) were qualified to teach the pre-college level courses and any new math +faculty were qualified to teach all of the math courses. + +For instance, a masters degree in mathematics education (instead of just +mathematics) was included as an optional qualification for full-time +instructors teaching pre-college level courses. Also a masters degree in +mathematics education became an option for part-time instructors teaching MTH +211--213 (the sequence for elementary education math teachers). Additionally, +at the request of the administration, the terms `part-time' and `full-time' +were removed from instructor qualifications in order to satisfy accreditation +requirements. Instead of labeling what had traditionally been part-time +qualifications as `part-time,' these qualifications were labeled `Criteria for +Provisional Instructors.' + +In Winter 2013, the math instructor qualifications were again changed at the +request of the math department chairs. The `provisional' labeling +from the last revision had required math department chairs to regularly +re-certify part-time (`provisional') instructors. In order to avoid this +unnecessary paperwork, the SAC adopted a three-tiered qualification structure +based on full-time, part-time, and provisionally-approved part-time instructors +(mainly graduate students currently working on graduate degrees). The +part-time (non-provisional) tier was labeled `Demonstrated Competency.' +Complete details of instructor qualifications are given in \vref{app:sec:instructorquals}. + + +\section[Professional development activities]{How have professional development + activities of the faculty contributed to the strength of the + program/discipline? If such activities have resulted in instructional or +curricular changes, please describe.} + +The members of the mathematics SAC, full-time and part-time alike, are very +committed to professional development. As with members of any academic +discipline, the faculty in the Math SAC pursue professional development in a +variety of manners. Traditionally these activities have been categorized in +ways such as `membership in professional organizations' or `presentations at +conferences'. The members of the Math SAC do not in any way devalue the +engagement in such organizations or activities, and in fact a summative list of +such things can be found in \vref{app:sec:memberships}. + +Nor do the members in any way diminish individual pursuit of professional +development. In an attempt to acknowledge such pursuits, each member of the +full-time faculty was asked to submit one or two highlights of their +professional development activities over the past five years. Those +submissions can be found in \vref{app:sec:professionaldevelop}. + +It should be noted that the list of organizations and activities found in these +appendices are not exhaustive; they are merely a representative sample of +the types of professional development pursuits engaged in by members of the +Math SAC. + +The members of the Math SAC realize that if there is going to be +institutional-level change that results in increased success and completion +rates for students enrolled in DE mathematics courses, there are going to have +to be targeted and on-going professional development activities with that goal +in mind and that all mathematics faculty, full-time and part-time, are going to +have to take advantage of those opportunities. This is especially important +since many of our faculty members are not specialists in working with +developmental mathematics students. We look forward to working with the broader +PCC community as we pursue our common goal of increased student success and +completion, and we look forward to the college's support in providing +professional development opportunities that promote attainment of this goal. + +\recommendation[PCC Cabinet]{The college should provide funds and other necessary resources + that allow the SAC members to engage in targeted, on-going professional + development geared toward realization of district-wide goals. This should + include, for example, support for activities such as annual two-day workshops + focusing on goals such as universal adoption of evidence-based best +practices.} + +\recommendation[Division Deans, Faculty Department Chairs, PCCFFAP, Completion Investment Council]{Each math department should create structures and policies that + promote sustained professional development. Institutionalization of practices + such as faculty-inquiry-groups and peer-to-peer classroom visitations are +necessary components of sustained professional development.} + +\recommendation[Math SAC, PCC Cabinet]{The college should continue to provide funds for activities + such as conference attendance, professional organization membership, etc. At + the same time, procedures should be put into place that allow for maximal + dissemination of ``good ideas'' and maximum probability that said ideas grow into +sustained practices.} + +\recommendation[Division Deans, Faculty Department Chairs, PCCFFAP]{Formalized procedures for mentoring new faculty, full-time and + part-time alike, should be adopted and strictly observed. Beginning a new job + is a unique opportunity for rapid professional development, and we need to make + sure that we provide as supportive and directed an opportunity for new faculty + as possible so that the development happens in a positive and long-lasting +way.} + diff --git a/test-cases/oneSentencePerLine/pcc-program-review3-mod1.tex b/test-cases/oneSentencePerLine/pcc-program-review3-mod1.tex new file mode 100644 index 00000000..114c2b90 --- /dev/null +++ b/test-cases/oneSentencePerLine/pcc-program-review3-mod1.tex @@ -0,0 +1,392 @@ +% arara: pdflatex: {files: [MathSACpr2014]} +% !arara: indent: {overwrite: yes} +\chapter{Needs of Students and the Community} +\epigraph{Everyone can rise above their circumstances and achieve success if + they are dedicated to and passionate about what they do.}{Nelson Mandela} + +\section[Student demographics and instruction]{How is instruction informed by + student demographics?} +In order to answer this question, we decided that we needed demographic categories beyond the normal categories that are provided by the college. +We decided to use age, sex, gender, race, creed, sexual orientation, learning ability, educational background, and socio-economic status. +Our instruction is informed by these student demographics in a variety of ways. +\label{needs:sec:definitiondiversity} + +\subsection[Social justice workgroup]{Social justice (addresses socio-economic + status, race, gender)} +The Math SAC has a Social Justice Workgroup that was formed in 2012 (detailed on \cpageref{cur:sub:socialJustic}). +Their objectives are to explore and discuss issues relating to diversity within the mathematics classroom as well as to create projects, activities, and other course content related to issues surrounding social and environmental justice. + +For example, in MTH 111 topics include: a fine in Yonkers, NY related to segregation; racial profiling in traffic stops; gentrification in Portland; and the Deepwater Horizon Oil Spill. +Many of these projects were adapted to fit various mathematical levels from MTH 20 to MTH 252. +Problems were also generated for MTH 243, using gun violence and international prison data. +Some samples of their work are given in \vref{app:sec:socialJustic}. + +\subsection{Individual faculty awareness} +A recent survey of Math faculty asked if they had ever modified instruction to meet our diversity goals. +The survey used our previous program review's diversity statement (Goal 3 on page 4 of \cite{mathprogramreview2003}) as a point of reference: \begin{quote} We will enrich the educational experience by committing to the development of diversity in our student body, faculty and staff. +\end{quote} +Here are some highlights and themes from the survey responses. +One faculty member reports \begin{quote} I have been learning about Complex Instruction, which has helped me attend to status in my classroom. + Who has high status and who has low status? + Complex Instruction (CI) provides opportunities to highlight the diversity of ways to be smart in a mathematics classroom\ldots so that all students can participate equally in the classroom activity. +\end{quote} +Another SAC member is dedicated to educating herself in the classroom, and reports \begin{quote} If there is a cultural barrier, my awareness and appreciation of diversity enables me to want to learn about the unfamiliar, and educate about my own. + My immense experience working in diverse settings with unique individuals constantly increases my awareness of what I can do to make someone feel comfortable and what I need to do to accept individuality without enforcing conformity. +\end{quote} +% On a related note, I would love to see the raw data from that survey. It may +% help inform how I can help my own division in this area. +Many of our faculty commented on the use of group work as a way to expose students to diverse ideas and culture. +They also indicated that they tried to be culturally aware when writing application problems by choosing different names, genders and roles for the characters in their problems. +The `Rule of Four' (functions and relations should be presented numerically, graphically, verbally and symbolically) is incorporated into most of our CCOGs. +The rule of four recognizes and highlights the different ways people prefer to learn mathematics. +\subsection[Educational cost]{Educational cost (addresses socio-economic condition)} +Our SAC is aware of the cost of course materials and considers the socio-economic condition of our student population when selecting texts. + +The SAC has a long-standing policy to require the same textbook for all sections of a course. +Since PCC has such a large student body and we offer many math classes, this policy has enabled the Math SAC to negotiate wholesale prices of textbooks (particularly custom editions) with publishers. +This saves students money when taking a sequence course (for example MTH 60/65) and allows students to sell back their book to the bookstore. + +Publishers can create a custom edition from an existing textbook by removing material (e. +g., chapters) or adding material (e.g., supplemental materials); +the publisher labels the textbook `A Custom Edition for Portland Community +College', and thus restricts its resale value, as it can only be used at PCC; +this benefits the publisher and enables them to reduce the price to PCC. + +Math SAC subcommittees have successfully implemented this idea with the textbooks for almost all of the mathematics classes taught at PCC: MTH 20, the MTH 60/61/62/63/65 sequences, MTH 95, MTH 111, MTH 112, MTH 105, the MTH 243/244 sequence, and the MTH 251/252/253/254 sequence. + +In addition to using custom editions uniformly across the district, we have a group that is investigating an in-house Pre-Calculus text to reduce dependency on publishers. +The group is inactive at this point because they have been unable to secure adequate release time; for more information, see \cpageref{cur:sec:111/112doc} and \cite{mth111project}. + +We actively pursue free and open source products such as WeBWorK---the fully accessible online homework system (see \cpageref{other:sec:webwork}). +This meets our goal of providing low cost curricular materials and also supports student access. +The University of Oregon has generously hosted several WeBWorK courses for PCC over the past few years. +Disability Services has provided strong support for WeBWorK, and we were able to procure our own WeBWorK server at PCC in the Fall of 2013. + +\subsection{Educational background} +We have several projects and classes in place to address our students' different educational backgrounds (\cpageref{cur:sec:other} details information on some of our initiatives). + +The Study Skills program (first discussed on \cpageref{cur:sub:studyskills}) was created to address the different educational backgrounds of our students, particularly those students who have underdeveloped study skills. +This program consists of seven topics all relating to study skills specific to mathematics: how learning math is different, resources available for help at PCC, time management, listening and note-taking skills, why and how to do homework, test taking strategies, and how to overcome math and test anxiety. +Each lesson is broken up into three parts: a short video to be watched by students outside of class, a student worksheet to be completed in conjunction with the video, and an in-class discussion lead by the instructor. + +MTH 07/08 (also known as AMP) described on \cpageref{other:sec:amp} addresses differences in educational backgrounds. +It allows students who have previous exposure to the material to attempt to move to a higher level class (see \vref{app:sec:ampdata}). + +Even with the above mentioned programs, we feel that the college could do a lot more when it comes to placing students into classes appropriately and orienting them to the demands of college. +We have formed the Placement Test Reform Group described on \cpageref{other:sec:placementreform} and would like to see more wrap-around services for students in developmental classes; these services would ideally begin before the students steps into the classroom. +We suggest the adoption of a placement test that measures study skills, motivation and academic preparedness. + +\recommendation[Math SAC, Advising, CG SAC, Student Learning Centers, Completion Investment Council]{We recommend that + students who are not academically prepared be required to + take a study skills course. + We would like to see more math-specific advisors and have enough advisors so that it is feasible for a student to see an advisor every term. + We would also like to see that all tutoring centers open during the first week of the term. + In our experience, students who are behind during the first week have a hard time catching up. +} + +\subsection{Data trends}\label{needs:sec:trends} +Despite the above mentioned efforts to have instruction informed by our student demographics, we have still found that there is an achievement gap when it comes to minority and underrepresented populations. +We have displayed data for five years in \vref{app:sec:demographicdata}; see \crefrange{app:tab:demographic2008-2009}{app:tab:demographic2012-2013}. +PCC has undergone vast enrollment changes over the last five years since our previous program review; here are the trends that we observed for this time period: \begin{itemize} \item The percentage of both White and Asian students increases as students progress through the sequence of MTH classes. + There appears to be a modest increase in diversity levels in MTH 251--254 over the last 5 years, but this may be due to more students identifying as Multiracial. + \item There is a slight increase in diversity since AY 2008 (the percentage + of students who identify as white has decreased in most of our courses). + \item There is a shockingly high number of students aged 19 or less who + place into MTH 20. + Since many of these students should have been exposed to the material from MTH 20 recently, we need to further examine both the placement exam and our communication with high schools. + For example, are high schools allowing students to use calculators too freely? + Are students who are otherwise proficient at algebra placing low due to not understanding fractions? + This is something that needs further investigation. + If we could decrease the number of young students placing into MTH 20, we might be able to shorten their path to a degree. + \item The percentage of students aged 50+ decreases through the DE + sequence. + These students likely have been out of the educational system the longest, so they face different challenges than their younger peers. + + \recommendation[Math SAC, Advising, Counseling]{We suggest intentionally creating support systems for students + aged 50+, particularly in MTH 60. } + \item There is a large decrease in the percentage of black students from + MTH 20 to MTH 60. + Not only is there a percentage decrease, there is also a decrease in the total number of black students in MTH 60 compared to MTH 20. + This indicates that MTH 20 is likely a significant barrier to some minority students or that minority students place into MTH 20 at a disproportionately high rate. + Although this is relatively consistent with national data, we would like the administration to continue to support programs like Passages, Project Independence, ROOTS, and other interventions to increase success rates of minority students. + In addition, a more diverse faculty might help with retention and passing rates; \emph{ the extent to which [the instructor's attributes] differ from the physical, cultural, and intellectual backgrounds of [his/her] students will have a profound effect on the interactions in [the] classroom. + }\footnote{\url{http://www.crlt.umich.edu/gsis/p3_2}} + \item The pass rates for black students are noticeably lower each year and + in each course. + + \recommendation[Math SAC, Advising, Multicultural Center]{We recommend + intentionally creating support systems for + black students studying mathematics.} + \item Females consistently pass MTH 20/60/65/95 at higher rates than males, + but a smaller proportion of females enter MTH 112 and the calculus + sequence, an important gateway to engineering careers. + + \recommendation[Math SAC, Advising, Women's Resource Center]{We + suggest identifying ways to encourage female students to continue on to + MTH 112 and related STEM careers.} + + Other options that support students in mathematics may not come from the Math SAC itself. + For example, the Math Club at Cascade serves as a good opportunity for females who enjoy mathematics to connect with and support each other. + However, such clubs are largely student led and participation can vary greatly from year to year and term to term. + + \item While female students are underrepresented in MTH 112, and MTH 251--254 + as noted above, it does appear that many female students take a statistics + route (MTH 243, 244) instead of a calculus route (MTH 251 and above). + MTH 243 and 244 lead toward many important career paths and are more directly relevant to students interested in these paths. + Many female students are by-passing the calculus route and entering 200 level mathematics directly instead. + The Math SAC recently voted to change the prerequisite for MTH 243, which could open and shorten this pathway for many more students (male and female alike) in years to come. + + \item The percentage of men passing MTH 20 is lower than that of female + students. + In addition, it appears that the percentage of males enrolling in MTH 20 is increasing (perhaps due to the economic downturn). + This is consistent with data at the secondary level. + Since MTH 20 is pre-algebra, some of this may be due to prior educational experiences and students' attitudes of their ability. +\end{itemize} + +\section[Changes in instruction due to changes in demographics]{Have there been + any notable changes in instruction due to changes in + demographics since the last review?} +At Cascade, the number of MWF classes has increased since the last program review. +This was done in response to the increased demand for MTH 61/62/63. +The increase in these classes seemed to coincide with a large influx of under-prepared students who returned to school after the recession. + +Classes that run three days a week are designed to help students who struggle with the demands of a two-day-a-week class. +While there isn't a notable difference in success rates between MWF classes and those that meet less frequently, it is felt that the shorter class time is better for students cognitively, their attention span is held longer and students engage in more frequent practice of mathematics. + +We would like to see more MWF or even MTWTh classes to provide more flexible scheduling options for the benefit of students. +We suggest that one way to accomplish this is to turn more MW classes into MWF classes. + +\section[Demand and enrollment patterns]{Describe current and projected demand + and enrollment patterns. + Include discussion of any impact this will have on the program/discipline. + } +Demand and enrollment patterns have been divided into two categories: Developmental and Lower Division Transfer Mathematics. + +\subsection{Developmental mathematics} +Referring to \cref{needs:fig:enrollmentDevelopTerm}, we see that enrollment in pre-college courses increased from AY2008 to AY2011 by 46\%; there was a slight decrease (5\%) in enrollment from AY2011 to AY2012. + +\begin{figure}[!htb] + \centering + \input{graphics/enrollmentDevelopmentalbyTermTimePlot.tex} + \caption{Enrollment in DE math by term} + \label{needs:fig:enrollmentDevelopTerm} +\end{figure} + +The counterpart to \cref{needs:fig:enrollmentDevelopTerm} \emph{by campus} is given in \cref{needs:tab:enrollmentDevelp} (see also \cref{app:fig:enrollmentDevelopCampus} in \vref{sec:app:enrollment}). +Enrollment in Developmental mathematics courses increased most at CA and SEC; from AY 2011 to AY 2012, enrollment in Developmental mathematics courses decreased at all campuses except SEC. +In many cases, sections that we would have liked to offer encountered scheduling difficulties in 2011/12 due to a lack in facility space---this is discussed further in \vref{facilities:sec:scheduling}. + +\begin{table}[!htb] + \centering + \caption{Developmental Mathematics Enrollment by Campus} + \label{needs:tab:enrollmentDevelp} + \begin{tabularx}{\linewidth}{X*{7}rr} + \toprule + & & & & & & \% change & \% change & \%change \\ + & & & & & & 2008/09-- & 2011/12-- & 2008/09-- \\ + & 2008/09 & 2009/10 & 2010/11 & 2011/12 & 2012/13 & --2011/12 & --2012/13 & --2012/13 \\ + \midrule + SY & 6764 & 8155 & 8847 & 9682 & 8840 & 43.14\% & $-8.70\%$ & 30.70\% \\ + CA & 4159 & 5745 & 5963 & 6585 & 5887 & 58.33\% & $-10.60\%$ & 41.55\% \\ + RC & 6625 & 8033 & 8192 & 8669 & 8454 & $30.85\%$ & $-2.48\%$ & 27.60\% \\ + ELC & 2785 & 3883 & 4404 & 4709 & 4860 & $69.08\%$ & 3.21\% & 74.50\% \\ + \bottomrule + \end{tabularx} +\end{table} + +\subsection{Lower division transfer mathematics} +Enrollment in Lower Division Collegiate (LDC) courses increased over the 5 year period of this Program Review, but at a decreasing rate (i. +e. the graph is +concave down). +This means that the overall number of students increased each year, but the rate of increase each year was smaller and smaller. +The increase in LDC enrollment could possibly be due to students looking toward PCC as a less expensive alternative to our 4 year counterparts. +It could also be a ``bubble'' of students who came to us during the economic downturn working their way up through our math sequence. +There was a 36\% enrollment increase from Summer 2011 to Summer 2012. +We suspect this is due to changes in financial aid eligibility. +Prior to this change, students were awarded financial aid for fall, winter, and spring, and needed a separate application for summer term. +After the change in eligibility, students were awarded aid for an entire academic year, commencing with Summer 2012. +This increase in enrollment is shown in \cref{needs:fig:enrollmentLDCTerm} with its per-campus counterpart in \vref{app:fig:enrollmentLDCCampus}. + +\begin{figure}[!htb] + \centering + \input{graphics/enrollmentLDCbyTermTimePlot.tex} + \caption{Enrollment in LDC, College Wide, by term} + \label{needs:fig:enrollmentLDCTerm} +\end{figure} + +In particular, five-year enrollment increases in LDC are large at all campuses, as shown in \cref{needs:tab:LDCenrollmentCampus}. +We expect the increase would be larger at SY if not for lack of facilities space. +A lot of this growth is in the Calculus sequence. + +\begin{table}[!htb] + \centering + \caption{LDC enrollment by campus} + \label{needs:tab:LDCenrollmentCampus} + \begin{tabular}{r*{6}{r}} + \toprule + & & & & & & \% Increase \\ + & 2008/09 & 2009/10 & 2010/11 & 2011/12 & 2012/13 & 2008/09--2012/13 \\ + \midrule + SY & 4096 & 4883 & 5405 & 7173 & 7297 & 78.15\% \\ + CA & 1497 & 2036 & 2042 & 3155 & 3435 & 129.46\% \\ + RC & 2920 & 3625 & 4451 & 6262 & 6424 & 120.00\% \\ + ELC & 291 & 484 & 621 & 1207 & 1387 & 376.63\% \\ + \bottomrule + \end{tabular} +\end{table} + +\subsection{Totals (DE and LDC combined)} +Overall enrollment increased from AY2008 to AY2011 by 63\%. +This significant increase reflects the downturn of the economy five years ago. +Many students returned to school because their jobs had ceased to exist or they hoped to better their chances of employment with a degree or certificate. +There was a slight decrease (2\%) in overall enrollment from AY2011 to AY 2012, which is mainly due to a decrease in enrollment in developmental mathematics courses (see \vref{app:fig:totalenrollmentTerm}). + +Each campus experienced slightly different enrollment trends. +Enrollment increases at CA and SEC from 2008--2011 were significantly higher than other campuses. +SEC experienced a 92. +33\% increase in enrollment over the 4 year +period and a continued enrollment increase from AY2011 to AY2012. +RC experienced the lowest \% drop (of campuses whose enrollment dropped) in enrollment from AY2011 to AY2012 (see \vref{needs:tab:enrollmentcampusyear} and \vref{app:fig:totalenrollmentCampus}). + +\begin{table}[!htb] + \centering + \caption{Enrollment by campus and year} + \label{needs:tab:enrollmentcampusyear} + \begin{tabularx}{\linewidth}{l*{8}{R}} + \toprule + & & & & & & \% change & \% change \\ + & 2008/09 & 2009/10 & 2010/11 & 2011/12 & 2012/13 & 2008/09--2011/12 & 2011/12--2012/13 \\ + \midrule + SY & 10860 & 13038 & 14252 & 16855 & 16137 & 55.20\% & $-4.26\%$ \\ + CA & 5656 & 7781 & 8005 & 9740 & 9322 & 72.21\% & $-4.29\%$ \\ + RC & 9545 & 11658 & 12643 & 14931 & 14878 & 56.43\% & $-0.35\%$ \\ + ELC & 3076 & 4367 & 5025 & 5916 & 6247 & 92.33\% & $5.59\%$ \\ + \bottomrule + \end{tabularx} +\end{table} + +Furthermore, while enrollment (number of students) has increased over a five-year period by 60\%, the number of sections offered has not kept pace (only increased by 40\%) as detailed in \cref{needs:tab:averageclasssize}; we are concerned that the average class size is increasing. + +\begin{table}[!htb] + \centering + \caption{Average class sizes (district wide)} + \label{needs:tab:averageclasssize} + \begin{tabular}{lS[table-format=2.2]} + \toprule + Year & {Average Class Sizes } \\ + \midrule + AY2008 & 24.87 \\ + AY2009 & 27.64 \\ + AY2010 & 27.36 \\ + AY2011 & 28.7 \\ + AY2012 & 28.4 \\ + \bottomrule + \end{tabular} +\end{table} + +While the average class size is somewhat small, there are classes that are much larger than the average. +There is little consistency between campuses when it comes to class size, which seems to be determined almost entirely by room choice; previous attempts at setting SAC-wide class sizes were not accepted by the Deans of Instruction. +We have resubmitted our report and are awaiting a response---the report \label{needs:page:classsize} can be viewed in full in \vref{app:sec:classsize}. + +The ratio of Pre-College to LDC enrollment has decreased (see \vref{app:fig:ratioDevelopToLDC}). +We are unsure of the reason for the decline in this ratio, but we are concerned that our completion rates have decreased, especially in developmental mathematics. +Our overall success rates have decreased with increased enrollment. +This could partially be explained by the large number of under-prepared students who entered the institution as a result of the economic recession---see \vref{app:tab:successratesbyterm}. + +Of concern is that while enrollment has increased from 2008 to 2013, hiring of full-time faculty has not kept pace. +In addition, the demands on full-time faculty (subcommittee work, LAS, CIC, etc. +) have increased. +However, if the economy continues to improve, it is expected that enrollment will level off or slightly decline for a short period of time. + +Since Governor Kitzhaber's proposal for the state of Oregon to have 40\% of adults earn a bachelors or higher degree, 40\% with an Associates, and 20\% with a high school or equivalent degree there is concern about how we will handle enrollment demands as policies to meet these goals are implemented. +In addition, the state mandate that students graduate with 9 college credits on their transcript means additional demands on faculty to coordinate dual credit programs, middle college and other programs designed to give high school students college credit. +Classroom space, faculty workload, class size and student preparedness are all major concerns. + +\section[Strategies to facilitate access and diversity]{What strategies are + used within the program/discipline to facilitate access and + diversity?}\label{needs:sec:access} +The Math SAC uses several strategies to facilitate access; for example, we offer all-day classes, hybrid classes, evening classes, distance learning classes and some weekend classes. +This allows students who aren't available for traditional weekday classes to access the mathematics program at PCC. +We offer many classes (MTH 60, 65, 95, 111, and 243) in either a weekend hybrid format or all day Saturday class. + +We facilitate access to students who learn differently or would like a different learning structure by offering Alternative Learning Center (ALC) self-paced math classes (see \vref{app:sec:alc}). + +We offer MTH 07/08 to returning students who are not happy with their placement exam scores. +This one-week intensive math review program is designed to help students place into higher level MTH courses which saves students time and money. +It also facilitates quicker access to a degree if students are able to place higher and shorten their time in the developmental sequence. +Even if students do not place into a higher course, it seems to help students fill in gaps in their knowledge. + +In Fall 2012 the Math SAC completed a large project centered around accessibility of online content for students with disabilities. +During Fall 2011, Mathematics faculty members had realized that our subject matter presented unique complications not faced by other disciplines. +Chris Hughes and Scot Leavit were granted release time to investigate accessibility as it applies to mathematics. +We are grateful for the support and the collaborative nature of the project. +\label{needs:page:disabilityservices} +The full text of the report, including recommendations made to the SAC, can be found at \cite{accessibilityproject} and a summary is given in \vref{app:sec:accessibility}. + +As a result of the project, faculty awareness of accessibility has increased significantly. +It has also lead to discussions surrounding adoption of commercial online homework management systems (see details of the ALEKS pilot in \vref{app:sec:aleks}) and an increased acceptance of WeBWorK, which is currently the only fully accessible online homework management system. +There has been considerable work done to develop problem libraries for MTH 60/65 in WeBWorK that match our curriculum---the details are discussed in \cpageref{other:sec:webwork}. + +Most faculty feel that we need further education on how to facilitate access and diversity in mathematics classes. +In particular we would like further discussion and training on the various types of accessibility challenges that we face, including physical accessibility, learning accessibility, cultural and social accessibility, and access to education. + +\subsection{Physical accessibility} +Many of our instructors have some experience serving students that have either a visual or hearing disability. +We appreciate the continued relationship and communication with the disabilities services on this issue. +Most of our issues of physical accessibility within the classroom are handled well by disability services. + +However, it is worth noting that on a SAC level, we face issues of accessibility in the facilities we use for our meeting space. +As one of the largest SACs in the district, we often have trouble finding room space that is large enough to accommodate our group and is accessible at the front of the room. +It is our understanding that the bond renovations will mostly address this issue. + +\subsection{Learning accessibility} +We would like continued training on how to provide equally effective instruction for students with learning disabilities. +We think that quarterly workshops (perhaps offered through disability services) could help us to be proactive and learn about methods that are specific to the teaching of mathematics. + +\subsection{Cultural and social accessibility} +Given our observations on \cpageref{needs:sec:trends}, we realize that we need further education, research, and training in strategies to provide equally effective instruction to students of all cultures, genders, and other facets (see our definition of diversity on \cpageref{needs:sec:definitiondiversity}). + +\subsection{Access to education for historically underrepresented populations} +We need more support to facilitate topics of social justice in a mathematics classroom. +We feel that students should know how to use mathematics as a tool for social change; forming our Social Justice Workgroup (\cpageref{cur:sub:socialJustic}) is a step in the right direction. +We are currently working on disseminating the activities and the discussions from this group and sharing them with the larger SAC. + +\section[Approved academic accommodations]{Describe the methods used to ensure + faculty are working with Disability Services to implement approved academic + accommodations?} +During the 2012/2013 academic year, the Office of Students with Disabilities went to a paperless notification system for all academic accommodation notifications. +Initially, this change to email notifications led to several problems. +One problem arose from the fact that not all faculty, especially part-time faculty, are as diligent in monitoring their PCC email as is necessary to make an email notification system work efficiently. +More problematically, there were glitches in PCC's email system that led to many of the notifications being misdirected to quarantine or spam folders. +As a result, there were students who had approved accommodations of which their instructors were unaware. + +To help remedy this situation, the mathematics department chairs contacted the Office of Students with Disabilities and asked if there were some way that a back-up system could be created to catch notifications that have fallen through the cracks. +In response, Kaela Parks (director of the OSD) has created a spaces page that lists every course in which there is at least one student enrolled who has approved accommodations. +Kaela had the foresight to create a page that updates in real time. +For example, if a student has made an accommodated testing request but the instructor has not yet completed the accommodated testing form, that class is flagged in red and the relevant department chair can contact the faculty member to let them know about the situation. + +There had been growing concern among several faculty members about the nature of many accommodations including: calculator usage that contradicts assessment criteria stated in CCOGs, and those that require flexibility in due dates (which can lead to the withholding of keys for other students). +Kaela Parks came to a mathematics SAC meeting to discuss these concerns, at which time she reiterated the concept of reasonable accommodations---that accommodations for student disabilities are not meant to compromise student learning outcomes. +Kaela also said that faculty can always contact her or the student's assigned OSD counselor to discuss specific accommodations of concern. + +\section[Curriculum/instructional changes due to internal/external + feedback]{Has feedback from students, community groups, transfer institutions, + business, industry or government been used to make curriculum or instructional + changes (if this has not been addressed elsewhere in this document)? + If so, describe. + } +Mathematics support for Career Technical Education (CTE) has evolved over the years. +Currently CTE students take mainstream math courses to fulfill their math requirement; this concerns PCC, other academic institutions, and officials in the State of Oregon as it is not obvious what benefit can be gained by taking courses meant for students destined to take Calculus classes. +Current issues involve: should PCC create math courses focused on CTE students only, how would students transfer between these courses and the general mathematics curriculum. +The following is taken from \cite{natcentereduc}. +\begin{quote} + The research we did revealed a major gap in the alignment between the mathematics courses taught in the mathematics departments in our community colleges and the mathematics actually needed to be successful in the applied programs students are taking. +\end{quote} +Research to develop a CTE-Math alternative track was underway but has stopped and be repurposed to fit our changing vision of DE math pathways. +The hope is that a STEM-focused pathway will provide more meaningful content for all students, regardless of their goals. +If we are not successful in our attempt to create the pathways developed during the NSF-IUSE initiative, we believe that creation of an independent pathway targeted specifically to CTE-Math students should be pursued. +We believe that such a pathway would increase completion rates for CTE students. +A CTE-Math pathway would also address concerns from CTE programs that our classes do not properly prepare their students for the mathematics that is used in their programs. + +Finally, the MTH 243 curriculum credit hour change detailed on \cpageref{other:sec:mth243} was initiated by student feedback. + diff --git a/test-cases/oneSentencePerLine/pcc-program-review3-mod2.tex b/test-cases/oneSentencePerLine/pcc-program-review3-mod2.tex new file mode 100644 index 00000000..53c1fd72 --- /dev/null +++ b/test-cases/oneSentencePerLine/pcc-program-review3-mod2.tex @@ -0,0 +1,381 @@ +% arara: pdflatex: {files: [MathSACpr2014]} +% !arara: indent: {overwrite: yes} +\chapter{Needs of Students and the Community} +\epigraph{Everyone can rise above their circumstances and achieve success if + they are dedicated to and passionate about what they do.}{Nelson Mandela} + +\section[Student demographics and instruction]{How is instruction informed by + student demographics?} +In order to answer this question, we decided that we needed demographic categories beyond the normal categories that are provided by the college. +We decided to use age, sex, gender, race, creed, sexual orientation, learning ability, educational background, and socio-economic status. +Our instruction is informed by these student demographics in a variety of ways. +\label{needs:sec:definitiondiversity} + +\subsection[Social justice workgroup]{Social justice (addresses socio-economic + status, race, gender)} +The Math SAC has a Social Justice Workgroup that was formed in 2012 (detailed on \cpageref{cur:sub:socialJustic}). +Their objectives are to explore and discuss issues relating to diversity within the mathematics classroom as well as to create projects, activities, and other course content related to issues surrounding social and environmental justice. + +For example, in MTH 111 topics include: a fine in Yonkers, NY related to segregation; racial profiling in traffic stops; gentrification in Portland; and the Deepwater Horizon Oil Spill. +Many of these projects were adapted to fit various mathematical levels from MTH 20 to MTH 252. +Problems were also generated for MTH 243, using gun violence and international prison data. +Some samples of their work are given in \vref{app:sec:socialJustic}. + +\subsection{Individual faculty awareness} +A recent survey of Math faculty asked if they had ever modified instruction to meet our diversity goals. +The survey used our previous program review's diversity statement (Goal 3 on page 4 of \cite{mathprogramreview2003}) as a point of reference: +\begin{quote} + We will enrich the educational experience by committing to the development of diversity in our student body, faculty and staff. +\end{quote} +Here are some highlights and themes from the survey responses. +One faculty member reports +\begin{quote} + I have been learning about Complex Instruction, which has helped me attend to status in my classroom. + Who has high status and who has low status? + Complex Instruction (CI) provides opportunities to highlight the diversity of ways to be smart in a mathematics classroom\ldots so that all students can participate equally in the classroom activity. +\end{quote} +Another SAC member is dedicated to educating herself in the classroom, and reports +\begin{quote} + If there is a cultural barrier, my awareness and appreciation of diversity enables me to want to learn about the unfamiliar, and educate about my own. + My immense experience working in diverse settings with unique individuals constantly increases my awareness of what I can do to make someone feel comfortable and what I need to do to accept individuality without enforcing conformity. +\end{quote} +% On a related note, I would love to see the raw data from that survey. It may +% help inform how I can help my own division in this area. +Many of our faculty commented on the use of group work as a way to expose students to diverse ideas and culture. +They also indicated that they tried to be culturally aware when writing application problems by choosing different names, genders and roles for the characters in their problems. +The `Rule of Four' (functions and relations should be presented numerically, graphically, verbally and symbolically) is incorporated into most of our CCOGs. +The rule of four recognizes and highlights the different ways people prefer to learn mathematics. +\subsection[Educational cost]{Educational cost (addresses socio-economic condition)} +Our SAC is aware of the cost of course materials and considers the socio-economic condition of our student population when selecting texts. + +The SAC has a long-standing policy to require the same textbook for all sections of a course. +Since PCC has such a large student body and we offer many math classes, this policy has enabled the Math SAC to negotiate wholesale prices of textbooks (particularly custom editions) with publishers. +This saves students money when taking a sequence course (for example MTH 60/65) and allows students to sell back their book to the bookstore. + +Publishers can create a custom edition from an existing textbook by removing material (e.g., chapters) or adding material (e.g., supplemental materials); the publisher labels the textbook `A Custom Edition for Portland Community College', and thus restricts its resale value, as it can only be used at PCC; this benefits the publisher and enables them to reduce the price to PCC. + +Math SAC subcommittees have successfully implemented this idea with the textbooks for almost all of the mathematics classes taught at PCC: MTH 20, the MTH 60/61/62/63/65 sequences, MTH 95, MTH 111, MTH 112, MTH 105, the MTH 243/244 sequence, and the MTH 251/252/253/254 sequence. + +In addition to using custom editions uniformly across the district, we have a group that is investigating an in-house Pre-Calculus text to reduce dependency on publishers. +The group is inactive at this point because they have been unable to secure adequate release time; for more information, see \cpageref{cur:sec:111/112doc} and \cite{mth111project}. + +We actively pursue free and open source products such as WeBWorK---the fully accessible online homework system (see \cpageref{other:sec:webwork}). +This meets our goal of providing low cost curricular materials and also supports student access. +The University of Oregon has generously hosted several WeBWorK courses for PCC over the past few years. +Disability Services has provided strong support for WeBWorK, and we were able to procure our own WeBWorK server at PCC in the Fall of 2013. + +\subsection{Educational background} +We have several projects and classes in place to address our students' different educational backgrounds (\cpageref{cur:sec:other} details information on some of our initiatives). + +The Study Skills program (first discussed on \cpageref{cur:sub:studyskills}) was created to address the different educational backgrounds of our students, particularly those students who have underdeveloped study skills. +This program consists of seven topics all relating to study skills specific to mathematics: how learning math is different, resources available for help at PCC, time management, listening and note-taking skills, why and how to do homework, test taking strategies, and how to overcome math and test anxiety. +Each lesson is broken up into three parts: a short video to be watched by students outside of class, a student worksheet to be completed in conjunction with the video, and an in-class discussion lead by the instructor. + +MTH 07/08 (also known as AMP) described on \cpageref{other:sec:amp} addresses differences in educational backgrounds. +It allows students who have previous exposure to the material to attempt to move to a higher level class (see \vref{app:sec:ampdata}). + +Even with the above mentioned programs, we feel that the college could do a lot more when it comes to placing students into classes appropriately and orienting them to the demands of college. +We have formed the Placement Test Reform Group described on \cpageref{other:sec:placementreform} and would like to see more wrap-around services for students in developmental classes; these services would ideally begin before the students steps into the classroom. +We suggest the adoption of a placement test that measures study skills, motivation and academic preparedness. + +\recommendation[Math SAC, Advising, CG SAC, Student Learning Centers, Completion Investment Council]{We recommend that + students who are not academically prepared be required to + take a study skills course. + We would like to see more math-specific advisors and have enough advisors so that it is feasible for a student to see an advisor every term. + We would also like to see that all tutoring centers open during the first week of the term. + In our experience, students who are behind during the first week have a hard time catching up.} + +\subsection{Data trends}\label{needs:sec:trends} Despite the above mentioned efforts to have instruction informed by our student demographics, we have still found that there is an achievement gap when it comes to minority and underrepresented populations. +We have displayed data for five years in \vref{app:sec:demographicdata}; see \crefrange{app:tab:demographic2008-2009}{app:tab:demographic2012-2013}. +PCC has undergone vast enrollment changes over the last five years since our previous program review; here are the trends that we observed for this time period: +\begin{itemize} + \item The percentage of both White and Asian students increases as students progress through the sequence of MTH classes. + There appears to be a modest increase in diversity levels in MTH 251--254 over the last 5 years, but this may be due to more students identifying as Multiracial. + \item There is a slight increase in diversity since AY 2008 (the percentage of students who identify as white has decreased in most of our courses). + \item There is a shockingly high number of students aged 19 or less who place into MTH 20. + Since many of these students should have been exposed to the material from MTH 20 recently, we need to further examine both the placement exam and our communication with high schools. + For example, are high schools allowing students to use calculators too freely? + Are students who are otherwise proficient at algebra placing low due to not understanding fractions? + This is something that needs further investigation. + If we could decrease the number of young students placing into MTH 20, we might be able to shorten their path to a degree. + \item The percentage of students aged 50+ decreases through the DE sequence. + These students likely have been out of the educational system the longest, so they face different challenges than their younger peers. + + \recommendation[Math SAC, Advising, Counseling]{We suggest intentionally creating support systems for students + aged 50+, particularly in MTH 60. } + \item There is a large decrease in the percentage of black students from MTH 20 to MTH 60. + Not only is there a percentage decrease, there is also a decrease in the total number of black students in MTH 60 compared to MTH 20. + This indicates that MTH 20 is likely a significant barrier to some minority students or that minority students place into MTH 20 at a disproportionately high rate. + Although this is relatively consistent with national data, we would like the administration to continue to support programs like Passages, Project Independence, ROOTS, and other interventions to increase success rates of minority students. + In addition, a more diverse faculty might help with retention and passing rates; \emph{ the extent to which [the instructor's attributes] differ from the physical, cultural, and intellectual backgrounds of [his/her] students will have a profound effect on the interactions in [the] classroom.}\footnote{\url{http://www.crlt.umich.edu/gsis/p3_2}} + \item The pass rates for black students are noticeably lower each year and in each course. + + \recommendation[Math SAC, Advising, Multicultural Center]{We recommend + intentionally creating support systems for + black students studying mathematics.} + \item Females consistently pass MTH 20/60/65/95 at higher rates than males, but a smaller proportion of females enter MTH 112 and the calculus sequence, an important gateway to engineering careers. + + \recommendation[Math SAC, Advising, Women's Resource Center]{We + suggest identifying ways to encourage female students to continue on to + MTH 112 and related STEM careers.} + + Other options that support students in mathematics may not come from the Math SAC itself. + For example, the Math Club at Cascade serves as a good opportunity for females who enjoy mathematics to connect with and support each other. + However, such clubs are largely student led and participation can vary greatly from year to year and term to term. + + \item While female students are underrepresented in MTH 112, and MTH 251--254 as noted above, it does appear that many female students take a statistics route (MTH 243, 244) instead of a calculus route (MTH 251 and above). + MTH 243 and 244 lead toward many important career paths and are more directly relevant to students interested in these paths. + Many female students are by-passing the calculus route and entering 200 level mathematics directly instead. + The Math SAC recently voted to change the prerequisite for MTH 243, which could open and shorten this pathway for many more students (male and female alike) in years to come. + + \item The percentage of men passing MTH 20 is lower than that of female students. + In addition, it appears that the percentage of males enrolling in MTH 20 is increasing (perhaps due to the economic downturn). + This is consistent with data at the secondary level. + Since MTH 20 is pre-algebra, some of this may be due to prior educational experiences and students' attitudes of their ability. +\end{itemize} + +\section[Changes in instruction due to changes in demographics]{Have there been + any notable changes in instruction due to changes in + demographics since the last review?} +At Cascade, the number of MWF classes has increased since the last program review. +This was done in response to the increased demand for MTH 61/62/63. +The increase in these classes seemed to coincide with a large influx of under-prepared students who returned to school after the recession. + +Classes that run three days a week are designed to help students who struggle with the demands of a two-day-a-week class. +While there isn't a notable difference in success rates between MWF classes and those that meet less frequently, it is felt that the shorter class time is better for students cognitively, their attention span is held longer and students engage in more frequent practice of mathematics. + +We would like to see more MWF or even MTWTh classes to provide more flexible scheduling options for the benefit of students. +We suggest that one way to accomplish this is to turn more MW classes into MWF classes. + +\section[Demand and enrollment patterns]{Describe current and projected demand + and enrollment patterns. + Include discussion of any impact this will have on the program/discipline. + } +Demand and enrollment patterns have been divided into two categories: Developmental and Lower Division Transfer Mathematics. + +\subsection{Developmental mathematics} +Referring to \cref{needs:fig:enrollmentDevelopTerm}, we see that enrollment in pre-college courses increased from AY2008 to AY2011 by 46\%; there was a slight decrease (5\%) in enrollment from AY2011 to AY2012. + +\begin{figure}[!htb] + \centering + \input{graphics/enrollmentDevelopmentalbyTermTimePlot.tex} + \caption{Enrollment in DE math by term} + \label{needs:fig:enrollmentDevelopTerm} +\end{figure} + +The counterpart to \cref{needs:fig:enrollmentDevelopTerm} \emph{by campus} is given in \cref{needs:tab:enrollmentDevelp} (see also \cref{app:fig:enrollmentDevelopCampus} in \vref{sec:app:enrollment}). +Enrollment in Developmental mathematics courses increased most at CA and SEC; from AY 2011 to AY 2012, enrollment in Developmental mathematics courses decreased at all campuses except SEC. +In many cases, sections that we would have liked to offer encountered scheduling difficulties in 2011/12 due to a lack in facility space---this is discussed further in \vref{facilities:sec:scheduling}. + +\begin{table}[!htb] + \centering + \caption{Developmental Mathematics Enrollment by Campus} + \label{needs:tab:enrollmentDevelp} + \begin{tabularx}{\linewidth}{X*{7}rr} + \toprule + & & & & & & \% change & \% change & \%change \\ + & & & & & & 2008/09-- & 2011/12-- & 2008/09-- \\ + & 2008/09 & 2009/10 & 2010/11 & 2011/12 & 2012/13 & --2011/12 & --2012/13 & --2012/13 \\ + \midrule + SY & 6764 & 8155 & 8847 & 9682 & 8840 & 43.14\% & $-8.70\%$ & 30.70\% \\ + CA & 4159 & 5745 & 5963 & 6585 & 5887 & 58.33\% & $-10.60\%$ & 41.55\% \\ + RC & 6625 & 8033 & 8192 & 8669 & 8454 & $30.85\%$ & $-2.48\%$ & 27.60\% \\ + ELC & 2785 & 3883 & 4404 & 4709 & 4860 & $69.08\%$ & 3.21\% & 74.50\% \\ + \bottomrule + \end{tabularx} +\end{table} + +\subsection{Lower division transfer mathematics} +Enrollment in Lower Division Collegiate (LDC) courses increased over the 5 year period of this Program Review, but at a decreasing rate (i.e. +the graph is +concave down). +This means that the overall number of students increased each year, but the rate of increase each year was smaller and smaller. +The increase in LDC enrollment could possibly be due to students looking toward PCC as a less expensive alternative to our 4 year counterparts. +It could also be a ``bubble'' of students who came to us during the economic downturn working their way up through our math sequence. +There was a 36\% enrollment increase from Summer 2011 to Summer 2012. +We suspect this is due to changes in financial aid eligibility. +Prior to this change, students were awarded financial aid for fall, winter, and spring, and needed a separate application for summer term. +After the change in eligibility, students were awarded aid for an entire academic year, commencing with Summer 2012. +This increase in enrollment is shown in \cref{needs:fig:enrollmentLDCTerm} with its per-campus counterpart in \vref{app:fig:enrollmentLDCCampus}. + +\begin{figure}[!htb] + \centering + \input{graphics/enrollmentLDCbyTermTimePlot.tex} + \caption{Enrollment in LDC, College Wide, by term} + \label{needs:fig:enrollmentLDCTerm} +\end{figure} + +In particular, five-year enrollment increases in LDC are large at all campuses, as shown in \cref{needs:tab:LDCenrollmentCampus}. +We expect the increase would be larger at SY if not for lack of facilities space. +A lot of this growth is in the Calculus sequence. + +\begin{table}[!htb] + \centering + \caption{LDC enrollment by campus} + \label{needs:tab:LDCenrollmentCampus} + \begin{tabular}{r*{6}{r}} + \toprule + & & & & & & \% Increase \\ + & 2008/09 & 2009/10 & 2010/11 & 2011/12 & 2012/13 & 2008/09--2012/13 \\ + \midrule + SY & 4096 & 4883 & 5405 & 7173 & 7297 & 78.15\% \\ + CA & 1497 & 2036 & 2042 & 3155 & 3435 & 129.46\% \\ + RC & 2920 & 3625 & 4451 & 6262 & 6424 & 120.00\% \\ + ELC & 291 & 484 & 621 & 1207 & 1387 & 376.63\% \\ + \bottomrule + \end{tabular} +\end{table} + +\subsection{Totals (DE and LDC combined)} +Overall enrollment increased from AY2008 to AY2011 by 63\%. +This significant increase reflects the downturn of the economy five years ago. +Many students returned to school because their jobs had ceased to exist or they hoped to better their chances of employment with a degree or certificate. +There was a slight decrease (2\%) in overall enrollment from AY2011 to AY 2012, which is mainly due to a decrease in enrollment in developmental mathematics courses (see \vref{app:fig:totalenrollmentTerm}). + +Each campus experienced slightly different enrollment trends. +Enrollment increases at CA and SEC from 2008--2011 were significantly higher than other campuses. +SEC experienced a 92.33\% increase in enrollment over the 4 year period and a continued enrollment increase from AY2011 to AY2012. +RC experienced the lowest \% drop (of campuses whose enrollment dropped) in enrollment from AY2011 to AY2012 (see \vref{needs:tab:enrollmentcampusyear} and \vref{app:fig:totalenrollmentCampus}). + +\begin{table}[!htb] + \centering + \caption{Enrollment by campus and year} + \label{needs:tab:enrollmentcampusyear} + \begin{tabularx}{\linewidth}{l*{8}{R}} + \toprule + & & & & & & \% change & \% change \\ + & 2008/09 & 2009/10 & 2010/11 & 2011/12 & 2012/13 & 2008/09--2011/12 & 2011/12--2012/13 \\ + \midrule + SY & 10860 & 13038 & 14252 & 16855 & 16137 & 55.20\% & $-4.26\%$ \\ + CA & 5656 & 7781 & 8005 & 9740 & 9322 & 72.21\% & $-4.29\%$ \\ + RC & 9545 & 11658 & 12643 & 14931 & 14878 & 56.43\% & $-0.35\%$ \\ + ELC & 3076 & 4367 & 5025 & 5916 & 6247 & 92.33\% & $5.59\%$ \\ + \bottomrule + \end{tabularx} +\end{table} + +Furthermore, while enrollment (number of students) has increased over a five-year period by 60\%, the number of sections offered has not kept pace (only increased by 40\%) as detailed in \cref{needs:tab:averageclasssize}; we are concerned that the average class size is increasing. + +\begin{table}[!htb] + \centering + \caption{Average class sizes (district wide)} + \label{needs:tab:averageclasssize} + \begin{tabular}{lS[table-format=2.2]} + \toprule + Year & {Average Class Sizes } \\ + \midrule + AY2008 & 24.87 \\ + AY2009 & 27.64 \\ + AY2010 & 27.36 \\ + AY2011 & 28.7 \\ + AY2012 & 28.4 \\ + \bottomrule + \end{tabular} +\end{table} + +While the average class size is somewhat small, there are classes that are much larger than the average. +There is little consistency between campuses when it comes to class size, which seems to be determined almost entirely by room choice; previous attempts at setting SAC-wide class sizes were not accepted by the Deans of Instruction. +We have resubmitted our report and are awaiting a response---the report \label{needs:page:classsize} can be viewed in full in \vref{app:sec:classsize}. + +The ratio of Pre-College to LDC enrollment has decreased (see \vref{app:fig:ratioDevelopToLDC}). +We are unsure of the reason for the decline in this ratio, but we are concerned that our completion rates have decreased, especially in developmental mathematics. +Our overall success rates have decreased with increased enrollment. +This could partially be explained by the large number of under-prepared students who entered the institution as a result of the economic recession---see \vref{app:tab:successratesbyterm}. + +Of concern is that while enrollment has increased from 2008 to 2013, hiring of full-time faculty has not kept pace. +In addition, the demands on full-time faculty (subcommittee work, LAS, CIC, etc. +) have increased. +However, if the economy continues to improve, it is expected that enrollment will level off or slightly decline for a short period of time. + +Since Governor Kitzhaber's proposal for the state of Oregon to have 40\% of adults earn a bachelors or higher degree, 40\% with an Associates, and 20\% with a high school or equivalent degree there is concern about how we will handle enrollment demands as policies to meet these goals are implemented. +In addition, the state mandate that students graduate with 9 college credits on their transcript means additional demands on faculty to coordinate dual credit programs, middle college and other programs designed to give high school students college credit. +Classroom space, faculty workload, class size and student preparedness are all major concerns. + +\section[Strategies to facilitate access and diversity]{What strategies are + used within the program/discipline to facilitate access and + diversity?}\label{needs:sec:access} +The Math SAC uses several strategies to facilitate access; for example, we offer all-day classes, hybrid classes, evening classes, distance learning classes and some weekend classes. +This allows students who aren't available for traditional weekday classes to access the mathematics program at PCC. +We offer many classes (MTH 60, 65, 95, 111, and 243) in either a weekend hybrid format or all day Saturday class. + +We facilitate access to students who learn differently or would like a different learning structure by offering Alternative Learning Center (ALC) self-paced math classes (see \vref{app:sec:alc}). + +We offer MTH 07/08 to returning students who are not happy with their placement exam scores. +This one-week intensive math review program is designed to help students place into higher level MTH courses which saves students time and money. +It also facilitates quicker access to a degree if students are able to place higher and shorten their time in the developmental sequence. +Even if students do not place into a higher course, it seems to help students fill in gaps in their knowledge. + +In Fall 2012 the Math SAC completed a large project centered around accessibility of online content for students with disabilities. +During Fall 2011, Mathematics faculty members had realized that our subject matter presented unique complications not faced by other disciplines. +Chris Hughes and Scot Leavit were granted release time to investigate accessibility as it applies to mathematics. +We are grateful for the support and the collaborative nature of the project. +\label{needs:page:disabilityservices} +The full text of the report, including recommendations made to the SAC, can be found at \cite{accessibilityproject} and a summary is given in \vref{app:sec:accessibility}. + +As a result of the project, faculty awareness of accessibility has increased significantly. +It has also lead to discussions surrounding adoption of commercial online homework management systems (see details of the ALEKS pilot in \vref{app:sec:aleks}) and an increased acceptance of WeBWorK, which is currently the only fully accessible online homework management system. +There has been considerable work done to develop problem libraries for MTH 60/65 in WeBWorK that match our curriculum---the details are discussed in \cpageref{other:sec:webwork}. + +Most faculty feel that we need further education on how to facilitate access and diversity in mathematics classes. +In particular we would like further discussion and training on the various types of accessibility challenges that we face, including physical accessibility, learning accessibility, cultural and social accessibility, and access to education. + +\subsection{Physical accessibility} +Many of our instructors have some experience serving students that have either a visual or hearing disability. +We appreciate the continued relationship and communication with the disabilities services on this issue. +Most of our issues of physical accessibility within the classroom are handled well by disability services. + +However, it is worth noting that on a SAC level, we face issues of accessibility in the facilities we use for our meeting space. +As one of the largest SACs in the district, we often have trouble finding room space that is large enough to accommodate our group and is accessible at the front of the room. +It is our understanding that the bond renovations will mostly address this issue. + +\subsection{Learning accessibility} +We would like continued training on how to provide equally effective instruction for students with learning disabilities. +We think that quarterly workshops (perhaps offered through disability services) could help us to be proactive and learn about methods that are specific to the teaching of mathematics. + +\subsection{Cultural and social accessibility} +Given our observations on \cpageref{needs:sec:trends}, we realize that we need further education, research, and training in strategies to provide equally effective instruction to students of all cultures, genders, and other facets (see our definition of diversity on \cpageref{needs:sec:definitiondiversity}). + +\subsection{Access to education for historically underrepresented populations} +We need more support to facilitate topics of social justice in a mathematics classroom. +We feel that students should know how to use mathematics as a tool for social change; forming our Social Justice Workgroup (\cpageref{cur:sub:socialJustic}) is a step in the right direction. +We are currently working on disseminating the activities and the discussions from this group and sharing them with the larger SAC. + +\section[Approved academic accommodations]{Describe the methods used to ensure + faculty are working with Disability Services to implement approved academic + accommodations?} +During the 2012/2013 academic year, the Office of Students with Disabilities went to a paperless notification system for all academic accommodation notifications. +Initially, this change to email notifications led to several problems. +One problem arose from the fact that not all faculty, especially part-time faculty, are as diligent in monitoring their PCC email as is necessary to make an email notification system work efficiently. +More problematically, there were glitches in PCC's email system that led to many of the notifications being misdirected to quarantine or spam folders. +As a result, there were students who had approved accommodations of which their instructors were unaware. + +To help remedy this situation, the mathematics department chairs contacted the Office of Students with Disabilities and asked if there were some way that a back-up system could be created to catch notifications that have fallen through the cracks. +In response, Kaela Parks (director of the OSD) has created a spaces page that lists every course in which there is at least one student enrolled who has approved accommodations. +Kaela had the foresight to create a page that updates in real time. +For example, if a student has made an accommodated testing request but the instructor has not yet completed the accommodated testing form, that class is flagged in red and the relevant department chair can contact the faculty member to let them know about the situation. + +There had been growing concern among several faculty members about the nature of many accommodations including: calculator usage that contradicts assessment criteria stated in CCOGs, and those that require flexibility in due dates (which can lead to the withholding of keys for other students). +Kaela Parks came to a mathematics SAC meeting to discuss these concerns, at which time she reiterated the concept of reasonable accommodations---that accommodations for student disabilities are not meant to compromise student learning outcomes. +Kaela also said that faculty can always contact her or the student's assigned OSD counselor to discuss specific accommodations of concern. + +\section[Curriculum/instructional changes due to internal/external + feedback]{Has feedback from students, community groups, transfer institutions, + business, industry or government been used to make curriculum or instructional + changes (if this has not been addressed elsewhere in this document)? + If so, describe. + } +Mathematics support for Career Technical Education (CTE) has evolved over the years. +Currently CTE students take mainstream math courses to fulfill their math requirement; this concerns PCC, other academic institutions, and officials in the State of Oregon as it is not obvious what benefit can be gained by taking courses meant for students destined to take Calculus classes. +Current issues involve: should PCC create math courses focused on CTE students only, how would students transfer between these courses and the general mathematics curriculum. +The following is taken from \cite{natcentereduc}. +\begin{quote} + The research we did revealed a major gap in the alignment between the mathematics courses taught in the mathematics departments in our community colleges and the mathematics actually needed to be successful in the applied programs students are taking. +\end{quote} +Research to develop a CTE-Math alternative track was underway but has stopped and be repurposed to fit our changing vision of DE math pathways. +The hope is that a STEM-focused pathway will provide more meaningful content for all students, regardless of their goals. +If we are not successful in our attempt to create the pathways developed during the NSF-IUSE initiative, we believe that creation of an independent pathway targeted specifically to CTE-Math students should be pursued. +We believe that such a pathway would increase completion rates for CTE students. +A CTE-Math pathway would also address concerns from CTE programs that our classes do not properly prepare their students for the mathematics that is used in their programs. + +Finally, the MTH 243 curriculum credit hour change detailed on \cpageref{other:sec:mth243} was initiated by student feedback. + diff --git a/test-cases/oneSentencePerLine/pcc-program-review3.tex b/test-cases/oneSentencePerLine/pcc-program-review3.tex new file mode 100644 index 00000000..ba3e5339 --- /dev/null +++ b/test-cases/oneSentencePerLine/pcc-program-review3.tex @@ -0,0 +1,581 @@ +% arara: pdflatex: {files: [MathSACpr2014]} +% !arara: indent: {overwrite: yes} +\chapter{Needs of Students and the Community} +\epigraph{Everyone can rise above their circumstances and achieve success if + they are dedicated to and passionate about what they do.}{Nelson Mandela} + +\section[Student demographics and instruction]{How is instruction informed by +student demographics?} +In order to answer this question, we decided that we needed demographic +categories beyond the normal categories that are provided by the college. We +decided to use age, sex, gender, race, creed, sexual orientation, learning +ability, educational background, and socio-economic status. Our instruction is +informed by these student demographics in a variety of ways. +\label{needs:sec:definitiondiversity} + +\subsection[Social justice workgroup]{Social justice (addresses socio-economic +status, race, gender)} +The Math SAC has a Social Justice Workgroup that was formed in 2012 (detailed +on \cpageref{cur:sub:socialJustic}). Their +objectives are to explore and discuss issues relating to diversity within the +mathematics classroom as well as to create projects, activities, and other +course content related to issues surrounding social and environmental justice. + +For example, in MTH 111 topics include: a fine in Yonkers, NY related +to segregation; racial profiling in traffic stops; gentrification +in Portland; and the Deepwater Horizon Oil Spill. Many of these projects were +adapted to fit various mathematical levels from MTH 20 to MTH 252. Problems +were also generated for MTH 243, using gun violence and international prison +data. Some samples of their work are given in \vref{app:sec:socialJustic}. + +\subsection{Individual faculty awareness} +A recent survey of Math faculty asked if they had ever modified instruction to +meet our diversity goals. The survey used our previous program review's +diversity statement (Goal 3 on page 4 of \cite{mathprogramreview2003}) as a +point of reference: +\begin{quote} + We will enrich the educational experience by committing to the development + of diversity in our student body, faculty and staff. +\end{quote} +Here are some highlights and themes from the survey responses. One faculty +member reports +\begin{quote} + I have been learning about Complex Instruction, which has helped me attend + to status in my classroom. Who has high status and who has low status? + Complex Instruction (CI) provides opportunities to highlight the diversity + of ways to be smart in a mathematics classroom\ldots so that all students + can participate equally in the classroom activity. +\end{quote} +Another SAC member is dedicated to educating herself in the classroom, and +reports +\begin{quote} + If there is a cultural barrier, my awareness and appreciation of diversity + enables me to want to learn about the unfamiliar, and educate about my own. + My immense experience working in diverse settings with unique individuals + constantly increases my awareness of what I can do to make someone feel + comfortable and what I need to do to accept individuality without enforcing + conformity. +\end{quote} +% On a related note, I would love to see the raw data from that survey. It may +% help inform how I can help my own division in this area. +Many of our faculty commented on the use of group work as a way to expose +students to diverse ideas and culture. They also indicated that they tried to +be culturally aware when writing application problems by choosing different +names, genders and roles for the characters in their problems. The `Rule of +Four' (functions and relations should be presented numerically, graphically, +verbally and symbolically) is incorporated into most of our CCOGs. The rule of +four recognizes and highlights the different ways people prefer to learn +mathematics. +\subsection[Educational cost]{Educational cost (addresses socio-economic condition)} +Our SAC is aware of the cost of course materials and considers the +socio-economic condition of our student population when selecting texts. + +The SAC has a long-standing policy to require the same textbook for all +sections of a course. Since PCC has such a large student body and we offer many +math classes, this policy has enabled the Math SAC to negotiate wholesale +prices of textbooks (particularly custom editions) with publishers. This saves +students money when taking a sequence course (for example MTH 60/65) and allows +students to sell back their book to the bookstore. + +Publishers can create a custom edition from an existing textbook by removing +material (e.g., chapters) or adding material (e.g., supplemental materials); +the publisher labels the textbook `A Custom Edition for Portland Community +College', and thus restricts its resale value, as it can only be used at PCC; +this benefits the publisher and enables them to reduce the price to PCC. + +Math SAC subcommittees have successfully implemented this idea with the +textbooks for almost all of the mathematics classes taught at PCC: MTH 20, the +MTH 60/61/62/63/65 sequences, MTH 95, MTH 111, MTH 112, MTH 105, the MTH 243/244 +sequence, and the MTH 251/252/253/254 sequence. + +In addition to using custom editions uniformly across the district, we have a +group that is investigating an in-house Pre-Calculus text to reduce dependency +on publishers. The group is inactive at this point because they have been +unable to secure adequate release time; for more information, see +\cpageref{cur:sec:111/112doc} and \cite{mth111project}. + +We actively pursue free and open source products such as WeBWorK---the fully +accessible online homework system (see \cpageref{other:sec:webwork}). This +meets our goal of providing low cost curricular materials and also supports +student access. The University of Oregon has generously hosted several WeBWorK +courses for PCC over the past few years. Disability Services has provided +strong support for WeBWorK, and we were able to procure our own WeBWorK server +at PCC in the Fall of 2013. + +\subsection{Educational background} +We have several projects and classes in place to address our students' +different educational backgrounds (\cpageref{cur:sec:other} details information on +some of our initiatives). + +The Study Skills program (first discussed on \cpageref{cur:sub:studyskills}) +was created to address the different educational +backgrounds of our students, particularly those students who have +underdeveloped study skills. This program consists of seven topics all relating +to study skills specific to mathematics: how learning math is different, +resources available for help at PCC, time management, listening and note-taking +skills, why and how to do homework, test taking strategies, and how to overcome +math and test anxiety. Each lesson is broken up into three parts: a short +video to be watched by students outside of class, a student worksheet to be +completed in conjunction with the video, and an in-class discussion lead by the +instructor. + +MTH 07/08 (also known as AMP) described on \cpageref{other:sec:amp} addresses +differences in educational backgrounds. +It allows students who have previous exposure to the material to attempt to +move to a higher level class (see \vref{app:sec:ampdata}). + +Even with the above mentioned programs, we feel that the college could do a lot +more when it comes to placing students into classes appropriately and orienting +them to the demands of college. We have formed the Placement Test Reform Group +described on \cpageref{other:sec:placementreform} and would like to see more +wrap-around services +for students in developmental classes; these services would ideally begin +before the students steps into the classroom. We suggest the adoption of a +placement test that measures study skills, motivation and academic +preparedness. + +\recommendation[Math SAC, Advising, CG SAC, Student Learning Centers, Completion Investment Council]{We recommend that + students who are not academically prepared be required to + take a study skills course. We would like to see more math-specific advisors + and have enough advisors so that it is feasible for a student to see an advisor + every term. We would also like to see that all tutoring centers open during the + first week of the term. In our experience, students who are behind during the +first week have a hard time catching up.} + +\subsection{Data trends}\label{needs:sec:trends} +Despite the above mentioned efforts to have instruction informed by our student +demographics, we have still found that there is an achievement gap when it +comes to minority and underrepresented populations. We have displayed data for +five years in \vref{app:sec:demographicdata}; see +\crefrange{app:tab:demographic2008-2009}{app:tab:demographic2012-2013}. PCC has +undergone vast enrollment changes over the last five years since our previous +program review; here are the trends that we observed for this time period: +\begin{itemize} + \item The percentage of both White and Asian students increases as students + progress through the sequence of MTH classes. There appears to be a + modest increase in diversity levels in MTH 251--254 over the last 5 + years, but this may be due to more students identifying as Multiracial. + \item There is a slight increase in diversity since AY 2008 (the percentage + of students who identify as white has decreased in most of our courses). + \item There is a shockingly high number of students aged 19 or less who + place into MTH 20. Since many of these students should have been exposed + to the material from MTH 20 recently, we need to further examine both the placement + exam and our communication with high schools. For example, are high + schools allowing students to use calculators too freely? Are students who + are otherwise proficient at algebra placing low due to not understanding + fractions? This is something that needs further investigation. If we + could decrease the number of young students placing into MTH 20, we might + be able to shorten their path to a degree. + \item The percentage of students aged 50+ decreases through the DE + sequence. These students likely have been out of + the educational system the longest, so they face different challenges + than their younger peers. + + \recommendation[Math SAC, Advising, Counseling]{We suggest intentionally creating support systems for students + aged 50+, particularly in MTH 60. } + \item There is a large decrease in the percentage of black students from + MTH 20 to MTH 60. Not only is there a percentage decrease, there is also + a decrease in the total number of black students in MTH 60 compared to + MTH 20. This indicates that MTH 20 is likely a significant barrier to + some minority students or that minority students place into MTH 20 at a + disproportionately high rate. Although this is relatively consistent with + national data, we would like the administration to continue to support + programs like Passages, Project Independence, ROOTS, and other interventions + to increase success rates of + minority students. In addition, a more diverse faculty might help with + retention and passing rates; \emph{ the extent to which [the instructor's attributes] + differ from the physical, cultural, and intellectual backgrounds of [his/her] students + will have a profound effect on the interactions in [the] classroom.}\footnote{\url{http://www.crlt.umich.edu/gsis/p3_2}} + \item The pass rates for black students are noticeably lower each year and + in each course. + + \recommendation[Math SAC, Advising, Multicultural Center]{We recommend + intentionally creating support systems for + black students studying mathematics.} + \item Females consistently pass MTH 20/60/65/95 at higher rates than males, + but a smaller proportion of females enter MTH 112 and the calculus + sequence, an important gateway to engineering careers. + + \recommendation[Math SAC, Advising, Women's Resource Center]{We + suggest identifying ways to encourage female students to continue on to + MTH 112 and related STEM careers.} + + Other options that support students in + mathematics may not come from the Math SAC itself. For example, the Math + Club at Cascade serves as a good opportunity for females who enjoy + mathematics to connect with and support each other. However, such clubs + are largely student led and participation can vary greatly from year to + year and term to term. + + \item While female students are underrepresented in MTH 112, and MTH 251--254 + as noted above, it does appear that many female students take a statistics + route (MTH 243, 244) instead of a calculus route (MTH 251 and above). MTH 243 + and 244 lead toward many important career paths and are more directly relevant + to students interested in these paths. Many female students are by-passing + the calculus route and entering 200 level mathematics directly instead. The + Math SAC recently voted to change the prerequisite for MTH 243, which could + open and shorten this pathway for many more students (male and female alike) + in years to come. + + \item The percentage of men passing MTH 20 is lower than that of female + students. In addition, it appears that the percentage of males enrolling + in MTH 20 is increasing (perhaps due to the economic downturn). This is + consistent with data at the secondary level. Since MTH 20 is pre-algebra, + some of this may be due to prior educational experiences and students' + attitudes of their ability. +\end{itemize} + +\section[Changes in instruction due to changes in demographics]{Have there been + any notable changes in instruction due to changes in +demographics since the last review?} +At Cascade, the number of MWF classes has increased since the last program +review. This was done in response to the increased demand for MTH 61/62/63. The +increase in these classes seemed to coincide with a large influx of +under-prepared students who returned to school after the recession. + +Classes that run three days a week are designed to help students who struggle +with the demands of a two-day-a-week class. While there isn't a notable +difference in success rates between MWF classes and those that meet less +frequently, it is felt that the shorter class time is better for students +cognitively, their attention span is held longer and students engage in more +frequent practice of mathematics. + +We would like to see more MWF or even MTWTh classes to provide more flexible +scheduling options for the benefit of students. We suggest that one way to +accomplish this is to turn more MW classes into MWF classes. + +\section[Demand and enrollment patterns]{Describe current and projected demand + and enrollment patterns. +Include discussion of any impact this will have on the program/discipline. } +Demand and enrollment patterns have been divided into two categories: +Developmental and Lower Division Transfer Mathematics. + +\subsection{Developmental mathematics} +Referring to \cref{needs:fig:enrollmentDevelopTerm}, we see that +enrollment in pre-college courses increased from AY2008 to AY2011 by 46\%; +there was a slight decrease (5\%) in enrollment from AY2011 to AY2012. + +\begin{figure}[!htb] + \centering + \input{graphics/enrollmentDevelopmentalbyTermTimePlot.tex} + \caption{Enrollment in DE math by term} + \label{needs:fig:enrollmentDevelopTerm} +\end{figure} + +The counterpart +to \cref{needs:fig:enrollmentDevelopTerm} \emph{by campus} is given in \cref{needs:tab:enrollmentDevelp} +(see also \cref{app:fig:enrollmentDevelopCampus} in \vref{sec:app:enrollment}). +Enrollment in Developmental mathematics courses increased most +at CA and SEC; from AY 2011 to AY 2012, enrollment in Developmental mathematics courses +decreased at all campuses except SEC. In many cases, +sections that we would have liked to offer encountered scheduling difficulties in 2011/12 due to a lack +in facility space---this is discussed further in \vref{facilities:sec:scheduling}. + +\begin{table}[!htb] + \centering + \caption{Developmental Mathematics Enrollment by Campus} + \label{needs:tab:enrollmentDevelp} + \begin{tabularx}{\linewidth}{X*{7}rr} + \toprule + & & & & & & \% change & \% change & \%change \\ + & & & & & & 2008/09-- & 2011/12-- & 2008/09-- \\ + & 2008/09 & 2009/10 & 2010/11 & 2011/12 & 2012/13 & --2011/12 & --2012/13 & --2012/13 \\ + \midrule + SY & 6764 & 8155 & 8847 & 9682 & 8840 & 43.14\% & $-8.70\%$ & 30.70\% \\ + CA & 4159 & 5745 & 5963 & 6585 & 5887 & 58.33\% & $-10.60\%$ & 41.55\% \\ + RC & 6625 & 8033 & 8192 & 8669 & 8454 & $30.85\%$ & $-2.48\%$ & 27.60\% \\ + ELC & 2785 & 3883 & 4404 & 4709 & 4860 & $69.08\%$ & 3.21\% & 74.50\% \\ + \bottomrule + \end{tabularx} +\end{table} + +\subsection{Lower division transfer mathematics} +Enrollment in Lower Division Collegiate (LDC) courses increased over the 5 +year period of this Program Review, but at a decreasing rate (i.e. the graph is +concave down). This means that the overall number of students increased each +year, but the rate of increase each year was smaller and smaller. The increase +in LDC enrollment could possibly be due to students looking toward PCC as a +less expensive alternative to our 4 year counterparts. It could also be a +``bubble'' of students who came to us during the economic downturn working +their way up through our math sequence. There was a 36\% enrollment increase +from Summer 2011 to Summer 2012. We suspect this is due to +changes in financial aid eligibility. Prior to this change, students were +awarded financial aid for fall, winter, and spring, and needed a separate +application for summer term. After the change in eligibility, students were +awarded aid for an entire academic year, commencing with Summer 2012. +This increase in enrollment is shown in \cref{needs:fig:enrollmentLDCTerm} with +its per-campus counterpart in \vref{app:fig:enrollmentLDCCampus}. + + +\begin{figure}[!htb] + \centering + \input{graphics/enrollmentLDCbyTermTimePlot.tex} + \caption{Enrollment in LDC, College Wide, by term} + \label{needs:fig:enrollmentLDCTerm} +\end{figure} + +In particular, five-year enrollment increases in LDC are large at all +campuses, as shown in \cref{needs:tab:LDCenrollmentCampus}. We expect the +increase would be larger at SY if not for lack of facilities space. A lot of +this growth is in the Calculus sequence. + +\begin{table}[!htb] + \centering + \caption{LDC enrollment by campus} + \label{needs:tab:LDCenrollmentCampus} + \begin{tabular}{r*{6}{r}} + \toprule + & & & & & & \% Increase \\ + & 2008/09 & 2009/10 & 2010/11 & 2011/12 & 2012/13 & 2008/09--2012/13 \\ + \midrule + SY & 4096 & 4883 & 5405 & 7173 & 7297 & 78.15\% \\ + CA & 1497 & 2036 & 2042 & 3155 & 3435 & 129.46\% \\ + RC & 2920 & 3625 & 4451 & 6262 & 6424 & 120.00\% \\ + ELC & 291 & 484 & 621 & 1207 & 1387 & 376.63\% \\ + \bottomrule + \end{tabular} +\end{table} + +\subsection{Totals (DE and LDC combined)} +Overall enrollment increased from AY2008 to AY2011 by 63\%. This significant +increase reflects the downturn of the economy five years ago. Many students +returned to school because their jobs had ceased to exist or they hoped to +better their chances of employment with a degree or certificate. There was a +slight decrease (2\%) in overall enrollment from AY2011 to AY 2012, which is +mainly due to a decrease in enrollment in developmental mathematics courses +(see \vref{app:fig:totalenrollmentTerm}). + + +Each campus experienced slightly different enrollment trends. Enrollment +increases at CA and SEC from 2008--2011 were significantly higher than other +campuses. SEC experienced a 92.33\% increase in enrollment over the 4 year +period and a continued enrollment increase from AY2011 to AY2012. RC +experienced the lowest \% drop (of campuses whose enrollment dropped) in +enrollment from AY2011 to AY2012 (see \vref{needs:tab:enrollmentcampusyear} and +\vref{app:fig:totalenrollmentCampus}). + +\begin{table}[!htb] + \centering + \caption{Enrollment by campus and year} + \label{needs:tab:enrollmentcampusyear} + \begin{tabularx}{\linewidth}{l*{8}{R}} + \toprule + & & & & & & \% change & \% change \\ + & 2008/09 & 2009/10 & 2010/11 & 2011/12 & 2012/13 & 2008/09--2011/12 & 2011/12--2012/13 \\ + \midrule + SY & 10860 & 13038 & 14252 & 16855 & 16137 & 55.20\% & $-4.26\%$ \\ + CA & 5656 & 7781 & 8005 & 9740 & 9322 & 72.21\% & $-4.29\%$ \\ + RC & 9545 & 11658 & 12643 & 14931 & 14878 & 56.43\% & $-0.35\%$ \\ + ELC & 3076 & 4367 & 5025 & 5916 & 6247 & 92.33\% & $5.59\%$ \\ + \bottomrule + \end{tabularx} +\end{table} + +Furthermore, while enrollment (number of students) has increased over a +five-year period by 60\%, the number of sections offered has not kept pace +(only increased by 40\%) as detailed in \cref{needs:tab:averageclasssize}; we +are concerned that the average class size is increasing. + +\begin{table}[!htb] + \centering + \caption{Average class sizes (district wide)} + \label{needs:tab:averageclasssize} + \begin{tabular}{lS[table-format=2.2]} + \toprule + Year & {Average Class Sizes } \\ + \midrule + AY2008 & 24.87 \\ + AY2009 & 27.64 \\ + AY2010 & 27.36 \\ + AY2011 & 28.7 \\ + AY2012 & 28.4 \\ + \bottomrule + \end{tabular} +\end{table} + +While the average class size is somewhat small, there are classes that are much +larger than the average. There is little consistency between campuses when it +comes to class size, which seems to be determined almost entirely by room +choice; previous attempts at setting SAC-wide class sizes were not accepted by +the Deans of Instruction. We have resubmitted our report and are awaiting a +response---the report \label{needs:page:classsize} can be viewed in full in \vref{app:sec:classsize}. + +The ratio of Pre-College to LDC enrollment has decreased (see +\vref{app:fig:ratioDevelopToLDC}). We are unsure of the reason for the decline +in this ratio, but we are concerned that our completion rates have decreased, +especially in developmental mathematics. Our overall success rates have +decreased with increased enrollment. This could partially be explained by the +large number of under-prepared students who entered the institution as a result +of the economic recession---see \vref{app:tab:successratesbyterm}. + +Of concern is that while enrollment has increased from 2008 to 2013, hiring of +full-time faculty has not kept pace. In addition, the demands on full-time +faculty (subcommittee work, LAS, CIC, etc.) have increased. However, +if the economy continues to improve, it is expected that enrollment will level +off or slightly decline for a short period of time. + +Since Governor Kitzhaber's proposal for the state of Oregon to have 40\% of +adults earn a bachelors or higher degree, 40\% with an Associates, and 20\% +with a high school or equivalent degree there is concern about how we will handle +enrollment demands as policies to meet these goals are implemented. In +addition, the state mandate that students graduate with 9 college credits on +their transcript means additional demands on faculty to coordinate dual credit +programs, middle college and other programs designed to give high school +students college credit. Classroom space, faculty workload, class size and +student preparedness are all +major concerns. + + +\section[Strategies to facilitate access and diversity]{What strategies are + used within the program/discipline to facilitate access and + diversity?}\label{needs:sec:access} +The Math SAC uses several strategies to facilitate access; for +example, we offer all-day classes, hybrid classes, evening classes, distance learning classes +and some weekend classes. This allows students who aren't available for traditional +weekday classes to access the mathematics program at PCC. We offer many classes +(MTH 60, 65, 95, 111, and 243) in either a weekend hybrid format or all day +Saturday class. + + +We facilitate access to students who learn differently or would like a +different learning structure by offering Alternative Learning Center (ALC) +self-paced math classes (see \vref{app:sec:alc}). + +We offer MTH 07/08 to returning students who are not happy with their +placement exam scores. This one-week intensive math review program is designed +to help students place into higher level MTH courses which saves students time +and money. It also facilitates quicker access to a degree if students are able +to place higher and shorten their time in the developmental sequence. Even if +students do not place into a higher course, it seems to help students fill in +gaps in their knowledge. + +In Fall 2012 the Math SAC completed a large project centered around accessibility of online content +for students with disabilities. During Fall 2011, Mathematics faculty members +had realized that our subject matter presented unique complications not faced by other +disciplines. Chris Hughes and Scot Leavit were granted release time to +investigate accessibility as it applies to mathematics. We are grateful for the +support and the collaborative nature of the project.\label{needs:page:disabilityservices} +The full text of the report, including recommendations made to the SAC, can be found at +\cite{accessibilityproject} and a summary is given in +\vref{app:sec:accessibility}. + +As a result of the project, faculty awareness of accessibility has increased +significantly. It has also lead to discussions surrounding adoption of +commercial online homework management systems (see details of the ALEKS pilot +in \vref{app:sec:aleks}) and an increased acceptance of WeBWorK, which is currently +the only fully accessible online homework +management system. There has been considerable work done to develop problem +libraries for MTH 60/65 in WeBWorK that match our curriculum---the details are +discussed in \cpageref{other:sec:webwork}. + +Most faculty feel that we need further education on how to facilitate access +and diversity in mathematics classes. In particular we would like further +discussion and training on the various types of accessibility challenges that +we face, including physical accessibility, learning accessibility, cultural and +social accessibility, and access to education. + +\subsection{Physical accessibility} +Many of our instructors have some experience serving students that have either +a visual or hearing disability. We appreciate the continued relationship and +communication with the disabilities services on this issue. Most of our issues +of physical accessibility within the classroom are handled well by disability +services. + +However, it is worth noting that on a SAC level, we face issues of +accessibility in the facilities we use for our meeting space. As one of the +largest SACs in the district, we often have trouble finding room space that is +large enough to accommodate our group and is accessible at the front of the +room. It is our understanding that the bond renovations will mostly address +this issue. + +\subsection{Learning accessibility} +We would like continued training on how to provide equally effective +instruction for students with learning disabilities. We think that quarterly +workshops (perhaps offered through disability services) could help us to be +proactive and learn about methods that are specific to the teaching of +mathematics. + +\subsection{Cultural and social accessibility} +Given our observations on \cpageref{needs:sec:trends}, we realize that we need +further education, research, and training in strategies to provide equally +effective instruction to students of all cultures, genders, and other facets +(see our definition of diversity on \cpageref{needs:sec:definitiondiversity}). + +\subsection{Access to education for historically underrepresented populations} +We need more support to facilitate topics of social justice in a mathematics classroom. We +feel that students should know how to use mathematics as a tool for social +change; forming our Social Justice Workgroup (\cpageref{cur:sub:socialJustic}) is +a step in the right direction. We are currently working on disseminating the activities and the discussions from this +group and sharing them with the larger SAC. + +\section[Approved academic accommodations]{Describe the methods used to ensure + faculty are working with Disability Services to implement approved academic +accommodations?} +During the 2012/2013 academic year, the Office of Students with Disabilities +went to a paperless notification system for all academic accommodation +notifications. Initially, this change to email notifications led to several +problems. One problem arose from the fact that not all faculty, especially +part-time faculty, are as diligent in monitoring their PCC email as is +necessary to make an email notification system work efficiently. More +problematically, there were glitches in PCC's email system that led to many of the +notifications being misdirected to quarantine or spam folders. As a result, +there were students who had approved accommodations of which their instructors +were unaware. + +To help remedy this situation, the mathematics department chairs contacted the +Office of Students with Disabilities and asked if there were some way that a +back-up system could be created to catch notifications that have fallen through +the cracks. In response, Kaela Parks (director of the OSD) has created a +spaces page that lists every course in which there is at least one student +enrolled who has approved accommodations. Kaela had the foresight to create a +page that updates in real time. For example, if a student has made an +accommodated testing request but the instructor has not yet completed the +accommodated testing form, that class is flagged in red and the relevant +department chair can contact the faculty member to let them know about the +situation. + +There had been growing concern among several faculty members +about the nature of many accommodations including: calculator usage that +contradicts assessment criteria stated in CCOGs, and those that require flexibility +in due dates (which can lead to the withholding of keys for other students). Kaela Parks came to a mathematics SAC +meeting to discuss these concerns, at which time she reiterated the concept of +reasonable accommodations---that accommodations for student disabilities are not +meant to compromise student learning outcomes. +Kaela also said that +faculty can always contact her or the student's assigned OSD counselor to +discuss specific accommodations of concern. + +\section[Curriculum/instructional changes due to internal/external +feedback]{Has feedback from students, community groups, transfer institutions, + business, industry or government been used to make curriculum or instructional + changes (if this has not been addressed elsewhere in this document)? If so, +describe. } +Mathematics support for Career Technical Education (CTE) has evolved over the +years. Currently CTE students take mainstream math courses to fulfill their +math requirement; this concerns PCC, other academic institutions, and +officials in the State of Oregon as it is not obvious what benefit can be gained +by taking courses meant for students destined to take Calculus classes. Current issues involve: should PCC create +math courses focused on CTE students only, how would students transfer between +these courses and the general mathematics curriculum. The following is taken +from \cite{natcentereduc}. +\begin{quote} + The research we did revealed a major gap in the alignment between the + mathematics courses taught in the mathematics departments in our community + colleges and the mathematics actually needed to be successful in the applied + programs students are taking. +\end{quote} +Research to develop a CTE-Math alternative track was underway but has stopped +and be repurposed to fit our changing vision of DE math pathways. The hope is +that a STEM-focused pathway will provide more meaningful content for all +students, regardless of their goals. +If we are not successful in our attempt to create the pathways developed during +the NSF-IUSE initiative, we believe that creation of an independent pathway +targeted specifically to CTE-Math students should be pursued. We believe that +such a pathway would increase completion rates for +CTE students. A CTE-Math pathway would also address concerns from CTE programs that our classes +do not properly prepare their students for the mathematics that is used in +their programs. + +Finally, the MTH 243 curriculum credit hour change detailed on \cpageref{other:sec:mth243} +was initiated by student feedback. + diff --git a/test-cases/oneSentencePerLine/pcc-program-review4-mod1.tex b/test-cases/oneSentencePerLine/pcc-program-review4-mod1.tex new file mode 100644 index 00000000..d1193a39 --- /dev/null +++ b/test-cases/oneSentencePerLine/pcc-program-review4-mod1.tex @@ -0,0 +1,705 @@ +% arara: pdflatex: {files: [MathSACpr2014]} +% !arara: indent: {overwrite: yes} +\chapter{Other Curricular Issues}\label{chap:otherissues} +\epigraph{Education is the only business still debating the usefulness of + technology.}{Rod Paige, former U. + S. + Secretary of Education (2002)} \section[Distance education]{To what degree are courses offered in a Distance modality (online, hybrid, interactive television, etc. + )? + For courses offered both via DL and on-campus, are there differences in student success? + (Contact + the Office of Institutional Effectiveness, either Laura Massey or Rob Vergun, + for course-level data). + If so, how are you, or will you address these differences? + What significant revelations, concerns or questions arise in the area of DL delivery? + }\label{other:sec:distancelearning} + +The Math SAC offers Distance Learning (DL) courses in online, hybrid, and interactive television (ITV) modalities. +We strive to make our DL course experience simulate the face-to-face course experience with respect to instructor presence, feedback, and assessment. +We use discussion boards to simulate the classroom learning environment, and an array of online homework platforms to assess and prepare our students effectively. +A Math SAC DL standing committee is charged with discussing the structure of our current DL courses, as well as developing and maintaining current DL best practices and standards. + +\subsection{Presence of DL offerings} +All of our pre-college level math courses (except a calculator skills course) have a DL offering, as do most of our lower-division collegiate courses. +Courses that are not offered using a distance modality fall into two categories: those on the high end of our collegiate courses, and specialty courses with low enrollments; \cref{tab:sec3:DLofferings} shows complete details. + +\begin{table} + \caption{Course Offerings through Distance Learning}\label{tab:sec3:DLofferings} + \centering + \begin{tabular}{ccccccccc} + \toprule + \multicolumn{3}{p{1in}}{Offered as DL} & \multicolumn{3}{p{1in}}{Not offered DL upper division} & \multicolumn{3}{p{1in}}{Not offered DL specialty} \\ + \midrule + 020 & 030 & 060 & 251 & 252 & 253 & 015 & 25C & 26C \\ + 065 & 070 & 084 & 254 & 256 & 261 & 061 & 062 & 063 \\ + 095 & 111 & 112 & & & & 093 & 105 & 211 \\ + 241 & 243 & 244 & & & & 212 & 213 \\ + \bottomrule + \end{tabular} +\end{table} + +Approximately 14. +1\% of PCC math enrollments were DL based during the +academic year 2012/13 compared to only 9.1\% in the 2007/08 academic year. +This percentage increase is coupled with a general enrollment surge over the past five years, and the number of DL enrollments has grown by over 150\% in this time period. +\Cref{fig:sec3:DLenrollments,fig:sec3:F2Fenrollments} show +student enrollment in face-to-face courses compared to online courses over six +academic years. +Note that even while overall enrollment has declined some since its peak in 2011/12, that absolute enrollment in DL courses has still grown. +\Cref{tab:sec3:F2FandDLdata2007,tab:sec3:F2FandDLdata2010} give more detailed +data---note that we do not offer classes above MTH 244 in a DL modality. + +\begin{figure}[!htb] + \begin{minipage}[t]{.5\textwidth} + %\includegraphics[width=\textwidth]{graphics/enrollmentInDL.pdf} + \input{graphics/enrollmentInDL.tex} + \caption{Enrollments in DL}\label{fig:sec3:DLenrollments} + \end{minipage}% + \begin{minipage}[t]{.5\textwidth} + %\includegraphics[width=\textwidth]{graphics/enrollmentInF2F.pdf} + \input{graphics/enrollmentInF2F.tex} + \caption{Enrollments in face-to-face classes}\label{fig:sec3:F2Fenrollments} + \end{minipage} +\end{figure} + +\begin{table}[!htb] + \begin{widepage} + \centering + \caption{DL \& Face-to-face (F2F) enrollments and pass rates 2007--2010} + \label{tab:sec3:F2FandDLdata2007} + \input{tables/dlvsF2FenrollPass2007-2010.tex} + \vspace{2pc} + \caption{DL \& Face-to-face (F2F) enrollments and pass rates 2010--2013} + \label{tab:sec3:F2FandDLdata2010} + \input{tables/dlvsF2FenrollPass2010-2013.tex} + \end{widepage} +\end{table} + +As enrollment demand for DL math courses has increased, we have increased the number of sections that we offer and trained more interested faculty in managing DL courses. +Between the academic years of 2003/04 and 2007/08, the annual number of sections offered increased from 51 to 87. +In the 2012/13 academic year, we offered 185 DL sections. +The resulting increase in sections offers access to students that can succeed in this modality and need this option due to outside constraints such as work and family. + +\subsection{Success rates in DL courses} +Pass rates in DL courses are quite noticeably lower than those for their face-to-face counterparts; \cref{fig:sec3:F2FandDLpassRates} visualizes the difference in pass rates between the highest enrollment DL courses that we offer and their face-to-face counterparts. +More detailed data for all DL offerings can be seen in \cref{tab:sec3:F2FandDLdata2007,tab:sec3:F2FandDLdata2010}---see also \vref{app:sec:dlsuccess}. +We recognize that students need a certain level of self-discipline, better study skills, and comfort engaging with technology to succeed in a DL course. +However we currently have no method for screening which students are less likely to succeed using a distance modality; our recommendations on \cpageref{other:sec:recommendations} attempt to address this issue. + +Referencing \cref{fig:sec3:F2FandDLpassRates}, it is clear that, in the six academic years shown, the pass rates generally decrease regardless of delivery mode. +We hypothesize that this overall trend is mostly the result of the economic collapse of 2008 which led to increased enrollment and changes in our student demographics (see demographics data in \vref{app:sec:demographicdata}). +But the pass rates in DL courses are as much as 30\% lower than in face-to-face counterparts and this large discrepancy needs to be addressed. + +\begin{figure}[!htb] + \begin{widepage} + \begin{subfigure}{.3\textwidth} + \input{graphics/passRatesByModality020.tex} + \captionof{figure}{MTH 20} + \end{subfigure}% + \begin{subfigure}{.3\textwidth} + \input{graphics/passRatesByModality060.tex} + \captionof{figure}{MTH 60} + \end{subfigure}% + \begin{subfigure}{.3\textwidth} + \input{graphics/passRatesByModality065.tex} + \captionof{figure}{MTH 65} + \end{subfigure} + + \vspace{2pc} + + \begin{subfigure}{.3\textwidth} + \input{graphics/passRatesByModality095.tex} + \captionof{figure}{MTH 95} + \end{subfigure}% + \begin{subfigure}{.3\textwidth} + \input{graphics/passRatesByModality111.tex} + \captionof{figure}{MTH 111} + \end{subfigure}% + \begin{subfigure}{.3\textwidth} + \input{graphics/passRatesByModality243.tex} + \captionof{figure}{MTH 243} + \end{subfigure} + \caption{Pass Rates By Modality} + \label{fig:sec3:F2FandDLpassRates} + \end{widepage} +\end{figure} + +The difference in student-success rates between on-campus courses and DL courses is an important issue for the Math SAC. +The Distance Learning Standing Committee has met to consider this issue and the factors that lead to this difference in success rates. +We can only speculate the reason for the disparity based on anecdotal evidence and professional experience. +Students may no longer see DL courses as unusual, so they may be unaware that successful DL math students should have stronger study skills, self-discipline, and time management skills than face-to-face math students absolutely need to be successful. +We believe that many students register for DL math courses without adequate understanding of the study habits, time commitment, learning styles, and technical skills that are necessary for success in these classes. +Anecdotal evidence suggests that some students who are aware of these issues and who would otherwise enroll in a face-to-face section still enroll in a DL section due to a lack of space in face-to-face sections. + +There is currently a DL orientation available for DL students, but there is no requirement that students complete it. +Furthermore, there is no information in the orientation to help students understand the particular challenges of studying \emph{mathematics} using the DL delivery methods. +In many disciplines, reading, writing, and discussion can be sufficient for learning. +Students in mathematics typically do not learn best until they have also acted, by working through exercises or active problem solving. +In face-to-face classes, instructors can monitor that this learning-through-action is happening more easily. +In DL courses, there is more of a need for students to rely on self-discipline to complete this portion of their learning, and this is not communicated in the existing DL orientation. + +\subsection{Informing DL students} +The Course Information Page (CIP) is accessible to students registering for DL courses and is meant to give section-specific information to students as they decide which sections to register for. +Many faculty members use this system to inform students of issues related to an online mathematics course. +For example, faculty address the misconception that a DL class requires fewer hours of attention per week than a face-to-face class. +We believe that many students do not visit the CIP for DL classes and continue to be unaware of the tools they will need to be successful in a DL mathematics course. +Some faculty members send emails to registered students before the term starts, asking them to read the CIP; it is not clear, however, how many students read this email or act on it. +The link to a CIP is only available via the online class, and not via MyPCC; this lack of presence may contribute to the issue. + +Other methods that are employed by DL faculty to directly communicate with their students include: \begin{itemize} \item using the Course Progress Notifications (CPNs); \item placing telephone calls to students; \item using Collaborate to hold online office hours in a kind of visual and aural chat session. +\end{itemize} + +\subsection{Online homework platforms} +Faculty have sought to increase engagement by DL students through use of online homework platforms. +An online homework platform can provide students with immediate feedback and also hold the student accountable for completion of assigned exercises. +Faculty can monitor progress and employ formative assessment from a distance. + +The SAC recognizes that program changes should come from research toward best practices. +Faculty members Wendy Fresh, Rebecca Ross, Tammy Louie, Jessica Bernards, and Diane Edwards have investigated the effects of use of an online homework system in several experiments in both DL and face-to-face courses. +In most cases, results from these experiments suggest there may be positive effects to using an online platform, but it remains too early to declare statistical significance. +To demonstrate statistical significance in studies of this nature requires considerably large sample sizes. + +However Jessica Bernards has been able to measure one positive effect to a significant degree. +Instructor Bernards taught several online sections of MTH 111, with control groups doing homework from the textbook and submitting paper write-ups, and experimental groups using online homework. +The withdrawal rate was 32\% for the control group and only 16\% for the experimental group, and this difference was statistically significant ($P<1\%$). +Instructor Wendy Fresh ran a very similar experiment with online sections of MTH 60. +There may still be an effect at that level, but more data is necessary to confirm with statistical significance. +Both instructors noted modest improvement in exam scores among the experimental group, but again more data is being gathered to confirm with significance. + +For more information on research by Instructors Bernards and Fresh for DL courses, see \vref{app:sec:onlinehwstudy}. +For information on research by instructors Edwards and Louie, see \vref{app:sec:aleks} and also \cpageref{sec3:subset:alekspilot}. +Research on the efficacy of WeBWorK (an online homework platform discussed on \cpageref{other:sec:webwork}) was done in \cite{focuswebwork}. +In \cite{brewer} it was found that when students are segregated by incoming ability, those who were less prepared when entering a course do benefit significantly from online homework use. +As a community college, we have more under prepared students than universities, so this finding suggests that use of online homework may be more helpful at PCC. +It is important to note that each of these studies were done with face-to-face courses; in DL courses the traditional homework alternative presents the challenge of delivery, complicating the question in favor of using online homework. + +\subsection{WeBWorK}\label{other:sec:webwork} +Recent exciting developments at PCC have centered around the free and open-source online homework platform called WeBWorK that is partially funded by the National Science Foundation and maintained by the Mathematical Association of America. +By Spring 2014 we expect that over 20 faculty will be using WeBWorK in their courses. +The Math SAC is also loaning out the services of Alex Jordan to CTE and LDC science SACs to create free online homework review programs. +We envision using WeBWorK for future Learning Assessment research and placement advising. +We are working with Dual Credit instructors to offer WeBWorK services to Portland Public Schools. + +Most of the textbooks currently in use by the Math SAC are published by Pearson Publishing, which offers MyMathLab for its online homework platform. +While MyMathLab and similar commercial products come as a bundled expense with new textbook purchases, a separate online account for pairing with a used textbook purchase is rather expensive. +For this reason, face-to-face instructors rarely require MyMathLab in their courses. +On the other hand, Distance Learning instructors have a stronger need for an online homework platform and the majority of DL instructors do require that students use (and pay for) MyMathLab. + +By contrast, WeBWorK is a platform for online homework that is free and open-source. +As there is no central headquarters for WeBWorK, it must be installed on a server somewhere. +Since joining the Math SAC in Spring 2009, Alex Jordan has championed the implementation and use of WeBWorK at PCC. +Some PCC math faculty have used WeBWorK in various capacities by borrowing server space from the University of Oregon, a relationship formed and maintained by Jordan. +This partnership between two Oregon state institutions has been mutually beneficial. +While PCC gained server access, PCC faculty members were programming content that the University of Oregon has been able to take advantage of. +Each term since Fall 2011, roughly 10 sections of PCC math courses have used the UO server. + +Over this period, WeBWorK users in the Math SAC lobbied Technology Solution Services to provide the Math SAC with its own WeBWorK server. +While the UO server provided service to us, it came with certain restrictions and complications that prevented WeBWorK at PCC from reaching its full potential. +For a time there was a chicken-and-egg situation, as TSS requested a greater usage by PCC faculty before arranging for a server while some faculty chose not to use WeBWorK because of the inconvenience of using the UO server. + +In the 2012/13 academic year, faculty Chris Hughes and Scot Leavitt researched accessibility issues (in the ADA sense) alongside Disability Services. +See \cite{accessibilityproject} for the full report. +Among many other findings, they found that MyMathLab (at the time of the project) had many significant accessibility problems while WeBWorK was quite close to being fully ADA compliant. +The open-source nature of WeBWorK meant that the few remaining obstacles to accessibility could be addressed. +They recommended that the SAC cease using MyMathLab for newly developed courses and newly developed online shells. +They also recommended that faculty migrate from MyMathLab to WeBWorK. +Disability Services supported their recommendations, and also began lobbying TSS for a PCC WeBWorK server. +Within the WeBWorK community PCC is now seen as a leader when it comes to accessibility issues. +See \cite{webworkblog} for a post about this on the WeBWorK news blog. +As a result of this, PCC is hosting a WeBWorK development camp in August 2014 with a central theme of addressing accessibility issues and enhancing its accessibility. +\label{other:page:disabilityservices} + +TSS partnered with the Clackamas Education Service District to deliver a WeBWorK server that has been fully implemented since Winter 2014. +SAC members Alex Jordan, Chris Hughes, and Xiaolong Yao have prepared \href{http://webwork. + pcc.edu}{webwork.pcc.edu} for regular use starting Winter +2014 term. +A backup server at \href{http://webwork-dev. + pcc.edu}{webwork-dev.pcc.edu} is in place for faculty +to experiment with. + +The arrival of our own WeBWorK installation has significant implications beyond homework management, particularly in the advising department. +We envisage that advisors would enroll students in a `review course' that contains (mostly) pre-college practice problems, and that the student would be encouraged to sit the COMPASS placement test only when they are comfortable with the problems in WeBWorK. +Furthermore, we can easily use WeBWorK as an advising tool to replace Hughes' Placement Advisory Test (\cite{mathprogramreview2003}, pages 12--13) in situations when students are not happy with their placement from COMPASS. +The SAC should work with advising to implement this. + +\subsection{PCC WeBWorK problem library} +WeBWorK has been in use at universities for some time now, and an extensive library exists of math problems for college level courses. +However there was weak content support for basic algebra and other pre-college topics. +Over Summer 2013, Alex Jordan, Chris Hughes, and Xiaolong Yao oversaw an effort to create a library of high-quality, algorithmically generated, basic algebra WeBWorK exercises which was partly funded with an IIP development grant; they received support from math instructors Kandace Kling, Debbie Neft, Jeremy Shaw, and Danielle Rice. +These exercises currently cover topics from MTH 60 and 65, and the team continues to add problems to the library for MTH 95. +The library development was a success because of the strong collaboration and dedication of the three faculty members, and the foundations that Jordan had laid in previous years. +Jordan, Hughes, and Yao presented their work at the STEM showcase (Rock Creek) in Fall 2013 (see \cref{webworkposter}). +It was at this showcase that the idea was hatched to create free online homework review programs for CTE and LDC science SACs. + +\begin{figure}[!htb] + \centering + \includegraphics[width=0.5\textwidth]{webworkposter} + \caption{WeBWorK poster from the PCC STEM Showcase}\label{webworkposter} +\end{figure} + +As time and funding progress, SAC members with the requisite coding experience hope to add more problems to this PCC library, expanding into the arenas of MTH courses 20, 111, 112, 243, and 244. +It is important to note the level of quality of the problems from this library. +Each problem has a full walk-through solution coded along side the question which can be put to use by faculty in a number of ways. +Each problem is given fine attention to detail so that automated feedback messages to the students are as informative as modern technology can allow. +This high level of quality requires time and experience to achieve. +However it is necessary if any instructor hopes to use WeBWorK as a teaching tool and not just an assessment tool. + +\subsection{Concerns about DL offerings} +Each of the following three issues have been raised by SAC members, and during the 2012/13 academic year a group of concerned faculty met to discuss them. +The meetings were informal and no binding decisions were reached. +\begin{itemize} + \item Faculty are concerned about whether or not Distance Learning is an + effective way to deliver math content, especially in light of the low pass + rate statistics seen in \cref{fig:sec3:F2FandDLpassRates}. + Successfully learning mathematics generally requires heavy active engagement. + Face-to-face courses facilitate this engagement by requiring students to be in the physical presence of their instructor and fellow students. + In DL courses, the imperative to remain engaged must come mostly from the student's own sense of responsibility and interest. + \item Faculty are concerned about the quality and consistency of current DL + courses. + Some faculty rely on publisher content such as electronic versions of textbooks, while other faculty have created complete sets of online notes themselves and use e-books only as secondary resources. + Instructor Chris Hughes serves as an advisor to online faculty creating new courses, and makes recommendations to improve course quality and observe accessibility standards. + However there is no enforcement of the online advisor's recommendations. + \item Faculty are concerned about the portion of a student's grade that may be + computed from online homework. + Compared to traditional homework, online homework is more readily vulnerable to cheating. + With many math exercises, the exercise can literally be typed in to Google and the search engine itself provides an answer. + Online homework provides fewer obstacles for a dishonest student to employ someone else to do their homework for them. + In fact, in Craigslist sites nationwide, all one need do is search for `mymathlab' to find advertisements from those who will `take your online math course for you' at a cost. + The Math SAC has always wanted its online courses to mirror its face-to-face courses, and as a consequence has never created CCOGs that treat face-to-face and online courses differently. + This has made it difficult to place any cap on the portion of a grade that may be computed from online homework. + There is also no consensus on what an appropriate cap would be. +\end{itemize} + +\subsection{Recommendations}\label{other:sec:recommendations} +Our main recommendations concern how to best inform students about the particular skills that a distance learning student should have or adopt in order to be successful. +We also recommend enacting some prerequisite items for DL registration to help give these skills to students. +Lastly there are some recommendations that do not fit these descriptions. +Many of these recommendations hold for face-to-face courses as well, and may be repeated elsewhere in this program review. +\begin{description} + \item For the Math SAC: + \begin{itemize}[label={}] + \item \recommendation[Math SAC]{Consider how the quality of online courses + could be improved by more effective regulation by the SAC. } + \end{itemize} + \item For Administration/Advising: + \begin{itemize}[label={}] + \item \recommendation[Math SAC, Distance Learning, Advising]{Advising and the Math SAC should collaborate to implement a WeBWorK-based review + mechanism for would-be placement test takers.} + \item \recommendation[Math SAC, Distance Learning, Advising]{Give students more information on + DL responsibilities and make students + aware of the difference in student-success statistics between DL and face-to-face courses.} + \item \recommendation[Math SAC, Distance Learning, Advising]{Encourage students to contemplate + why they seek to take a DL course and + reflect upon whether it will align well with their learning style and + personal skill sets.} + \end{itemize} + \item For Administration/DL/TSS: + \begin{itemize}[label={}] + \item \recommendation[Distance Learning, TSS]{Have the online orientation linked from the registration tool in MyPCC and + require that students complete this orientation before registering for a DL + class.} + \item \recommendation[Math SAC, Distance Learning, Advising]{Include a section in the DL orientation that addresses the specific + challenges that DL brings to mathematics courses. + Perhaps only students seeking to register for a mathematics DL course would be required to complete this section. + } + \item \recommendation[TSS]{Add redundant access to the Course Information Page. + Along with access through the online Class Schedule, the CIP could be available through MyPCC on the home page for a course and through Desire To Learn. + } + \item \recommendation[Math SAC, TSS]{Include a pop-up or hover-over window that is activated when a student + tries to register for a DL MTH class that gives specific information about the + challenges of DL Math courses. } + \end{itemize} + \item For Administration/Other: + \begin{itemize}[label={}] + \item \recommendation[Math SAC, Curriculum Committee]{Require students to demonstrate pre-requisite computer literacy skills + such as those taught in basic internet skills (CAS 104), beginning Word (CAS + 216), beginning keyboard (CAS 121), and basic computer skills/MS Office (CAS + 133).} + \item \recommendation[CAS SAC]{Develop and require a basic DL/computer skills competency course, possibly + offered during week 0 of the term. } + \item \recommendation[Math SAC, Division Deans, Deans of Instruction]{Provide opportunities for faculty professional development in research + design and data analysis to help with research efforts on the efficacy of + online homework.} + \item \recommendation[Math SAC, Division Deans, Deans of Instruction, Advising, Completion Investment Council]{Provide + support for further development of WeBWorK related projects, + including a larger library of math problems for courses beyond 60/65/95, + enhancements of the WeBWorK engine, and content for placement advising/review.} + \end{itemize} +\end{description} + +\section[Curricular changes resulting from educational initiatives]{Has the SAC + made any curricular changes as a result of exploring/adopting educational + initiatives (e.g., Service Learning, Internationalization of the Curriculum, + Inquiry-Based Learning, Honors, etc.)? + If so, please describe. + }\label{cur:sec:curchange} + +The Math SAC has made numerous substantial changes to its curriculum. +Those that are based in exploring or adopting educational initiatives are listed here. +More changes to the math curriculum are discussed in \vref{cur:sec:other}. + +\subsection{MTH 111H College Algebra: Honors}\label{cur:sub:111H} + +The course has been offered only at Sylvania campus---Winter 2012 (12 students), Winter 2013 (22 students), Spring 2013 (15 students), and Fall 2013 (17 students). +Ronda Lively was the instructor the first three terms, which allowed her to evolve her materials and activities. +Ann Cary taught the Fall 2013 term, and has collaborated closely with Ronda Lively. + +The honors course must cover the same material as the regular course. +It is stressed that honors versions of a course should not be ``harder'', but different in the use of class time and activities/assignments. +There should also be a component of Community and Environmental Responsibility, which is a PCC Core Outcome that is usually difficult to place in math courses. +Instructor Lively regularly teaches MTH 111 and MTH 111H during the same term. +The same exams were given in both courses. +There were differences in the other evaluation criteria used in the courses. +In the MTH 111 class, students submitted take home graded worksheets and participated in an in-class graded group activity. +The evaluation of the students in the MTH 111H class included: \begin{itemize} \item a collaborative computer project involving math history and investigation of several applications of math; \item a team quiz-grading activity where each group wrote a key and grading rubric, then applied it to two (fictional) students' quizzes; \item a community tutoring project: over several weeks, each student found someone to tutor in math (friend, neighbor, family member, \ldots) and then wrote a paper on their experience. +\end{itemize} +Since the overall student ability level was high, there was time in class to investigate other topics of interest related to college algebra. +Each term there were several students that enrolled because of the time slot, not because they were strong in math. +Encouragingly, the stronger students took the less prepared students under their wings and helped them to be successful. + +\subsection{Social justice workgroup}\label{cur:sub:socialJustic} +A Math and Social Justice workgroup was formed by Ann Cary and Emiliano Vega in response to a national convention they attended. +The group has collected and disseminated data sets and activities to participating math instructors and has gained interest and participants from other disciplines at PCC, as well as area high school math instructors and community activists in Portland. +More importantly, the group has the focus of providing a forum on how to discuss potentially sensitive subjects in a classroom setting when using application problems and how to be more culturally and socially aware of individual students and classes. +The information they gathered has improved the pool of activities and application problems available, improved the ability of instructors to work effectively with the broad demographic of students and co-workers, and also continues the college's focus on two Core Outcomes: Community and Environmental Responsibility and Cultural Awareness. +For a sample of material from this workgroup, see \vref{app:sec:socialJustic}. + +\subsection{Service learning}\label{other:sec:servicelearning} +Service Learning has been a part of many math instructors' courses at PCC, but has been deepened through the Service Learning website which includes additional resources and syllabi submitted by participating instructors at PCC. +In addition, Service Learning will be added to some CCOGs evaluation criteria to encourage instructors to incorporate Service Learning in their math classes. +Jeff Pettit participated as an observer in the Service Learning training cohort at Sylvania campus, connecting with instructors in other disciplines and gaining an understanding of how Service Learning is employed in other courses. +This has led to new curriculum in his Statistics courses and upper-division courses where Service Learning was not originally employed. + +\subsection{Developmental Education math study group} +A new committee was formed by the SAC to address developmental math completion rates. +The committee is researching the feasibility, cost and difficulty associated with implementing ``pathways'' beyond the current calculus focused MTH 60--95 courses. +The committee is considering options for employing career-based math course series and a statistics-based math course series. + +\subsection{Placement test reform group}\label{other:sec:placementreform} +A committee has been formed to address placement test reform. +The group intends to better measure students' needs beyond the current math-skills COMPASS test. +We hope to find a way to measure key traits and needs of students to connect student populations with the support needed to better guarantee success. +% I had encouraged these guys to work with student services, who are also +% addressing these concerns. I don't know if they are or not though. I do +% know that student services is working with the NSF Grant proposal team on +% these issues. Perhaps a little more should be said here? + +\section[Present dual credit relationships]{Are there any courses in the program + that are offered as Dual Credit at area High Schools? + If so, describe how the SAC develops and maintains relationships with the HS faculty in support of quality instruction. + Please note any best practices you have found, or ideas about how to strengthen this interaction. + } + +During the 2012/13 academic year, PCC dual credit was awarded for seven mathematics courses. +Classes were offered at seven high schools and there were a total of twelve instructors certified to teach PCC dual credit mathematics classes. +There were a total of 750 unduplicated students who enrolled in at least one PCC dual credit mathematics class and collectively those students earned 6032 mathematics credits through PCC. +In Fall 2012, an ad hoc committee was formed in the mathematics SAC to investigate the status of our dual credit program. +The formation of this committee was prompted, in part, by the discovery that several of the posted dual credit syllabi described courses that bore little resemblance to the course for which students were earning PCC credit. +The committee decided that the root cause of this disconnect was a lack of robust support on our part. +Three concrete actions were taken to address the disconnect: \begin{itemize} \item Each dual credit mathematics instructor was assigned a team of two support faculty from the mathematics departments at PCC. + Each pair of support faculty visited their assigned instructor at that instructor's high school. + These meetings were rather informal; the intent being to establish a concrete support team for each high school instructor. + \item A two-day mandatory summer workshop was organized by the committee in + conjunction with Beth Molenkamp, who at that time was the coordinator of + PCC's dual credit program. + At the workshop each dual credit instructor was tasked to complete a robust (and accurate) syllabus for each of their dual credit classes. + The PCC faculty helped with this task and all of the dual credit instructors now have syllabi that truly reflect the nature of the course for which the students are earning PCC credit. + The remainder of the workshop was spent sharing resources and pedagogical tactics used by various PCC faculty in the courses for which dual credit is also offered. + \item A Google Drive site was created to share resources. + Although the inspiration for this site was to give our dual credit faculty easy access to shared resources, the pooling of resources is obviously of great benefit for PCC faculty as well. +\end{itemize} + +\section[Future dual credit relationships]{Does the SAC plan to develop any + additional Dual Credit agreements with area high schools? + If so please describe. + If not, what does the SAC see as barriers to developing further dual credit agreements. + } +Students at Central Catholic High School will get their first opportunity to earn PCC mathematics dual credit during the 2013/14 academic year. +This adoption was coordinated through the dual credit program; that is, the Math SAC played no active role in the creation of this dual credit agreement. + +There is concern in the mathematics SAC that the state's 40-40-20 initiative, and the accompanying bills aimed at encouraging high school students to earn college credits, might lead to a dramatic increase in the number of high schools offering dual credit for mathematics courses. +The greatest challenge is that there are not that many high school mathematics instructors who meet PCC's qualifications to teach post-100 level mathematics courses. +We are concerned that the day might come where we are pressured to lower those standards or, of even more concern, we are pressured to start awarding PCC dual credit for developmental mathematics courses (MTH 95 or below). + +\subsubsection{Addendum} +As feared, we are now being asked to allow high school instructors who do not satisfy minimum qualifications to teach transfer level courses. +As currently proposed, a high school instructor who does not meet minimum qualifications would be paired with an ``instructor of record'' who does meet the qualifications. +There is also a possibility that after a time the high school instructor will be deemed to have ``demonstrated competency'' and will at that point be allowed to become the instructor of record based upon that criterion. +We are concerned by this proposal on many levels. + +The first is fundamental: this proposal undermines our established ``minimum qualifications. +'' +While we realize that the pressure to make these changes originates from the State of Oregon and other outside parties, we +need to be mindful that our accreditation is also at stake. + +Additionally, there are fears that the concept will seep into the manner in which we staff classes on our own campuses; an alternative minimum qualification such as ``demonstrated competency'' cannot be exclusive to teachers in the high school classrooms. + +Finally, if the concept takes off at the dual credit level, there are serious workload concerns for the faculty at PCC. +The title of ``instructor of record'' comes with a serious amount of responsibility and accountability; authentic and ongoing involvement in these courses will require time from a faculty that is already stretched for time. +We are presently being asked to revamp our entire DE curriculum (and are actively involved in that pursuit), and adding increased dual credit involvement to our list of duties will take away time from that agenda. +Priorities need to be established. +If the college chooses to pursue this change in dual credit policy we hope that the changes are instituted in a manageable and reputable way. + +\section[Other significant curricular changes]{Identify and explain any other + significant curricular changes that have been made since the last + review.}\label{cur:sec:other} + +The industrious Math SAC has made numerous changes to its curriculum that stemmed from a variety of sources other than broad educational initiatives. +(Curricular changes +stemming from broad educational initiatives are discussed in +\vref{cur:sec:curchange}.) These changes often arose from the perceived needs +of our students, innovative ideas from our faculty, evolutions in technology, +administrative restructuring, +and good old-fashioned housekeeping. + +\subsection{MTH 20 moved to the Math SAC from the DE SAC} +The MTH 20 curriculum was moved into the Math SAC from the DE SAC in Fall 2012, bringing all math curriculum under the same SAC. +This move was meant to help create consistency in the CCOGs across the spectrum of math courses, as well as ensure that the MTH 20 curriculum is adequately preparing students for the next math course. + +Sylvania Campus, which had a separate DE Math department altogether, transitioned its DE Math instructors into the Math Department in Fall 2013. +A Math Integration Work Group was formed and charged with creating a seamless path for this transition. +With the DE Math instructors in the Math SAC and the current college focus on success in pre-college math courses, the Math SAC's focus is on producing high-yield instructional practices, student success, and completion across the span of math courses offered by the college. + +\subsection{MTH 20 proposed credit change: 4- to 5-credit}\label{cur:sub:mth20} +MTH 20 (Basic Math) is a content-heavy course that covers topics such as fractions, decimals, signed number operations, geometry, proportions, and percents. +It can be argued that the amount of material covered in MTH 20 is greater than in any of our other mathematics courses. +At times, instructors are forced to either minimize required topics or occasionally cut them entirely due to time constraints. +Because of this, for years many MTH 20 instructors have wanted to increase the number of credits for the course. + +In October 2012, the SAC received a memo from the DOIs related to class sizes in which we were encouraged to consider converting MTH 20 from 4- to 5-credits; a subcommittee was formed by the SAC to investigate the benefits and consequences of increasing the number of credits. +The committee looked into the financial aid impact on students, the impact on degree/certificate programs, and the impact on classroom availability. +It also rewrote the CCOG to include study skills and increase the emphasis on reading graphs and geometry in the course. + +In April 2013, the Mathematics SAC approved the conversion of MTH 20 from a 4-credit course to a 5-credit course. +The conversion was then approved by the Curriculum Committee in November 2013. +Unfortunately, the current DOIs denied the recommendation in late November 2013; since the original recommendation came to the Math SAC in 2012, the college leadership has changed at many levels, and with these changes have come changes in perspectives and goals for the math curriculum. +The Math SAC is currently engaged in reevaluating and reorganizing pre-college level math at all levels; it is highly likely that the first course will require 5 credits for optimal student success. + +\subsection{MTH 60/65/70/95 curriculum alignment} +The Math SAC recognized that students successfully completing MTH 65 often had difficulty passing MTH 95. +The same was true for students transitioning between MTH 95 and MTH 111. + +It was thought that creating more continuity between the MTH 60/65 series and MTH 95 would improve student success. +To this end, during 2008/09, a committee was created to redesign the 60/65/95 curriculum with an eye toward carefully preparing students for the rigor of college level mathematics. +While MTH 60, MTH 65 and MTH 95 had been traditionally taught as algebraically focused classes, the committee adjusted the curriculum to reflect the need for students to be able to understand mathematical information via the `rule of four': algebraically, graphically, numerically and verbally. +This was done to prepare students for the demands of college level math and to align with the best practices of our field. +Importance was also placed on the use of a graphing calculator in MTH 95 to aid in this. +These changes were also reflected in the intermediary course in the MTH 60/65/95 series: MTH 70. + +As with all curricular changes, there continues to be a need for ensuring that all of the instructors receive the necessary communication and support in implementing these changes. +This is especially true for the part-time instructors who are teaching a large proportion of the MTH 60--95 courses. +However, with the nature of the part-time instructor's working conditions, this continues to be a challenge. +The Math SAC requests more support from the administration to provide the necessary funding for part-time instructors to attend course-specific meetings similar to the one held for MTH 95 instructors at the Sylvania Campus prior to the Fall 2013 term. + +\subsection{Replaced MTH 111A/111B/111C with MTH 105 and MTH 111} +In 1997 the Math SAC split MTH 111 into three courses in order to target different student populations: MTH 111A for liberal art students, MTH 111B for business and other non-technical majors, and MTH 111C for Science and Engineering. +In our last Program Review, \cite{mathprogramreview2003}, it was mentioned that we eliminated MTH 111A and resurrected MTH 105 (see \cite{mathprogramreview2003} page 19). +Since then, MTH 111B and 111C have merged again into MTH 111. + +The CCOGs for MTH 111B and MTH 111C had grown increasingly similar; since both were prerequisites for the same courses (MTH 243 and MTH 112), they needed to cover the same content. +MTH 111B had a reputation for being an easier course and many instructors noticed that students in MTH 112 who had taken MTH 111B instead of MTH 111C were less prepared. +Since the two courses no longer served different purposes, and were creating problems with student preparation for subsequent courses, we decided to unify MTH 111B and MTH 111C into a single college algebra course starting in Fall 2012: MTH 111. + +\subsection{MTH 243 credit change: 4- to 5-credit}\label{other:sec:mth243} +The Math SAC increased credits for MTH 243 (Statistics I) from 4-credits to 5-credits for several reasons, most of which were related to a need to increase the contact hours from four hours to five hours. +In order to address the needs of future coursework in statistics as well as sufficient coverage of material for transfer to many universities, it was essential to add more material to the 4-credit MTH 243 course. +Increasing the credit hours allowed for the necessary contact time to cover such material appropriately. + +Five contact hours allows for more integration of technology into the classroom, since these technology skills are best learned with hands-on guidance from the instructor. +Formerly, it was often difficult to have meaningful technology-oriented statistical classroom exercises due to the lack of contact time. + +The change to five contact hours also gives sufficient time to fully engage the students with critical thinking exercises and quantitative and statistical literacy discussions. + +\subsection[Creation of AMP/MTH008]{Creation of two accelerated review courses + (also referred to as the Accelerated Math Program, or AMP) MTH 07 and MTH 08} +\label{other:sec:amp} +\begin{description} + \item[MTH 07: Accelerated Basic Math Review] This course presents a review of + basic math skills and provides the opportunity for guided practice. + Topics include operations with whole numbers, fractions, decimals, proportions and percents. + + \item[MTH 08: Accelerated Introductory Algebra Review] This course presents a + brief review of basic algebra skills and provides the opportunity for guided + practice. + Topics include real number operations, manipulating linear expressions, solving linear equations, and graphing linear equations in two variables. +\end{description} + +These two courses were designed to meet the needs of the following two student populations: \begin{itemize} \item students who have previously learned the material and are able to test into the next level of math as a result of a brief review; \item students who have difficulty with the materials and can work on a variety of the regular course material in advance of taking the regular course. +\end{itemize} + +Both courses are offered for one week in-between terms and are 15 non-credit lab hours. +They are taught with a combination of mini lectures and computer practice/instruction. +At the completion of each course, students retake the COMPASS placement test. +Each term a significant number of students taking these courses have placed into a MTH course above their previous COMPASS placement. + +Sections have been offered at Rock Creek, Southeast, and Cascade, with most offerings at Cascade, where the courses were initially conceived and implemented by math instructors Holli Adams and Michael Marciniak. +Data from the sections taught at Cascade Campus since 2010 can be viewed in \vref{app:sec:ampdata}. + +\subsection{Clarified CCOG requirements and addenda} +It was found that there were numerous discrepancies among different sections of the same course having different instructors regarding the material being presented. +In an effort to ensure that students completing different sections of the same course had similar mathematical competencies, the SAC determined that communicating the requirements for a course needed to be made more concise. +Also, since the curriculum had significantly changed, we wanted instructors who had previously taught the course to know about these changes. +The CCOG for each course was intentionally written more clearly and now includes specific minimum requirements for testing and grading. +In addition, each CCOG now has an addendum that clearly shows examples of what is expected in terms of content, mathematical notation and presentation as well as well-defined assessment strategies. +This practice has now been adopted for most of our CCOGs. + +\subsection{Elimination of MTH 91 and MTH 92} +MTH 91 and MTH 92 were created to address the issue of the high failure rate in MTH 95 by splitting up the content of MTH 95 into two terms. +The course sequence was discontinued after data showed that students taking MTH 91 and 92 were not successful in the subsequent course, MTH 111; it was found that after taking these slower paced classes, the students were not prepared for the speed of the MTH 111 course. + +\subsection{Changes in MTH 251--254} +The calculus series has been more strongly split into Calculus I/II and Calculus III/Vector Calculus I by requesting the publisher split the current text into two sections. +This change altered the need for Maple in MTH 251 and MTH 252. +Maple is an expensive graphing software package that students buy for one year but generally use only for Vector Calculus I. +Attaching Maple to the new second half of the book solved the issue of students losing access to it if they took more than one year to complete the Calculus series. + +\subsection{Math study skills material development}\label{cur:sub:studyskills} +Research has shown that students with strong study skills are more successful in their academic pursuits than their counterparts; however, many students entering developmental mathematics courses lack these skills. +In an effort to help students build a stronger awareness of how a successful student studies, Math SAC member Jessica Bernards from the Rock Creek Campus created a Math Study Skills program to be used in our developmental math courses. +This program consists of seven topics all relating to study skills specific to mathematics: how learning math is different, resources available for help at PCC, time management, listening and note-taking skills, how to do homework, test taking strategies, and overcoming math and test anxiety. + +Each lesson has three parts: a short video to be watched by students outside of class, a student worksheet to be completed in conjunction with the video, and an in-class discussion led by the instructor. +Additionally, each topic has quotes from successful students which help strengthen the ideas in each video. +Many math instructors across all campuses piloted the program in the Spring 2013 and are continuing to use it this Fall 2013. +For Winter 2014, fourteen DE math instructors have reported that they will be using it. +The study skills website can be found at \cite{studyskills}. + +\subsection{MTH 111/112 document project}\label{cur:sec:111/112doc} +In Winter 2010, Math SAC member Chris Hughes proposed that the SAC write its own MTH 111/112 textbook. +This idea arose from a general frustration with commercially available textbooks for this sequence. +Available books tend to fall on one end or another of a spectrum ranging from template-based and lacking in conceptual understanding to abstract and lacking in guidance for students. +We seek something with better balance. +Such a textbook could also be provided to students at a much lower cost than any commercial product. + +Initially over 10 members of the Math SAC became involved, submitting ideas and small sections of what might someday become a textbook. +As time passed, four SAC members (Chris Hughes, Alex Jordan, Ann Cary, and Steve Simonds) maintained serious interest in the project. +Piecing together earlier work from the larger group, expanding on that work, and editing, these four produced a rough draft chapter representing about 10\% of a final product. +(Given that this draft would +need editing, we estimate that it represents 5\% of the work necessary for +completion.) + +At this point the four remaining editors put active work on hold until some level of release time can be secured that would enable completion in a timely manner. +A completed textbook for the entire sequence could be drafted with three faculty taking one-third release time for two consecutive terms. +An additional such term would provide for peripherals such as guided lecture notes, an online homework library, and LiveScribe videos. +The progress to date can be found at \cite{mth111project}. +% Math 111 textbook, recommendations/request: I hope that this is among your +% recommendations in chapter 6? + +\subsection{Supplemental course packets} +Textbooks that the Math SAC selects for courses often have gaps when compared to the CCOGs for that course. +Supplemental course packets were created to fill in the gaps and are required for those specific classes. +These include explanations of topics not covered in the textbook as well as example problems to fully cover a topic that might be lacking in the textbook examples. +Supplemental course packets have been created for MTH 60, 65, 95, 111 and 112, and can be (freely) downloaded from the Math department's web site \cite{pccmathdept}. + +\subsection{MTH 251 lab manual} +Since the late 1990s, MTH 251 has been taught in a lecture/lab format. +From that time through the late 2000s the materials used during the lab portion of the course were frequently modified. +By 2009 the lab manual had devolved into a collection of random problems and there was simply no connection between one set of problems and the next; there also were limited central themes to any one set of problems. + +In Summer 2009 faculty member Steve Simonds rewrote the lab manual from scratch. +The problem sets were written in a deliberate way to help students develop deep understanding of key concepts covered in the course. +The majority of the problems from the prior lab manual were then shuttled to the appendix as practice problems for outside of class. +All of the practice problems were fully keyed so that the students could continue thinking about the ideas (and practicing the skills) covered in lab and then determine for themselves if they had come to reasonable conclusions. + +\subsection{MTH 105 course material flexibility} +Each math course has traditionally used the same SAC approved textbook district-wide. +The Math SAC broke from this tradition and voted to allow MTH 105 instructors to choose their own course material, provided it meets the approval of the MTH 105 CCOG committee. +Unlike other math classes, MTH 105 is not a prerequisite for other math courses, and is a terminal math course for many of our students. +Each term, the instructor selects three to five topics from a list of 17. +This allows the instructors flexibility to teach material appropriate for the student population of each class. + +\subsection{ALC math courses} +The ALC math courses are self-paced pre-college math courses\footnote{The Alternative Learning Center (ALC) was an old name for the current Sylvania Student Learning Center. +}. +They are designed for students to work independently at their own pace and allow them to focus on specific topics. +Consequently, a wide range of students take these courses: students who are afraid to take a math class and want to get back into math slowly; students who failed a math class once or several times; students who feel that they placed too low on the placement test and just need a review; students who want to get through the material quickly; and international students who know the math but not the English terminology for it. +At Sylvania, the majority of students who take ALC Math are students who have failed math classes, sometimes many times. + +Historically, the ALC math courses have been offered at Sylvania Campus, housed by the Developmental Education SAC, and covered math content through MTH 65. +Since Summer 2012, they have also been offered at Southeast. +Since Winter 2013, ALC is housed in the Math SAC and, since Fall 2013, it also includes MTH 95. +For a more thorough look at these changes see \vref{app:sec:alc}. +Considerations are currently being made to find ways to have ALC Math at Cascade and Rock Creek. +Students from these campuses are already using ALC Math at Sylvania and Southeast and are undergoing the hardship of travel just so they can take these courses. + +Enrollments at Sylvania and Southeast both show that there is clearly a need for these courses. +Research done by PCC's Institutional Effectiveness on data from five years at Sylvania shows that students who complete ALC Math successfully pass their math classes at a higher rate than before taking ALC Math (see \vref{app:sec:effectivenessALC}). + +\recommendation[Math SAC, Deans of Instruction, Deans of Students, Advising, Completion Investment Council]{We recommend using the ALC + math classes as an early intervention when students fail math classes.} + +At Sylvania, for instance, some full-time advisors have familiarized themselves with the ALC math courses and suggest them to students early on. +Others send students to the Math Coordinator for further advising regarding successfully completing math classes. + +\subsection{MTH 84: Introduction to \LaTeX}\label{other:sec:mth84} +In Spring 2010, Math SAC members Alex Jordan and Chris Hughes proposed a pilot course to teach the typesetting software \LaTeX. +The experimental, one-credit course was piloted for three consecutive terms (Fall 2010, Winter 2011, and Spring 2011) and then adopted by the SAC as MTH 84. +The course was first run (as MTH 84) in Winter 2012, and has run each term since with one section per term. +MTH 84 is a one-credit pass/no-pass course. +Its modality has been DL, although the CCOG does not prevent a face-to-face version. +The course serves students and faculty alike in many areas. +\LaTeX\ is a useful tool in math, the sciences, in graphic design, and in +publishing; it can easily be used to typeset internal documents, such as \href{http://www.youtube.com/watch?v=XhduoHOYXUY}{\color{black} + Program Reviews}. + +\subsection{MTH 76 Math SAC approval} +The SAC approved the CCOG for a one-credit `Introduction to GeoGebra' course. +The course is planned to run as a pilot course in Spring 2014 and Summer 2014, with tentative approval to let it run as a permanent course Fall 2014. +The audience for the course includes PCC students, PCC instructors who wish to use it as a teaching tool, and K--12 teachers who wish to use it as a teaching tool. +The course was requested by high school teachers participating in the Dual Credit workshop in Summer 2013. + +\subsection[ALEKS pilot]{Pilot using ALEKS technology in two math courses during AY 2012/13}\label{sec3:subset:alekspilot} +ALEKS technology requires students to complete each mathematics topic successfully, keeps track of student work time, provides instant feedback, routinely assesses students and requires them to revisit previously learned material. +It allows students to study a variety of topics at a time and minimizes practice of mastered material. +Two pilots of ALEKS in MTH 20 and MTH 112 were conducted. + +\begin{description} + \item[MTH 20: Basic Mathematics] ALEKS was incorporated into six online and six + on-campus MTH 20 classes. + Data was compared to the previous year's MTH 20 classes taught by the same two instructors, Diane Edwards and Marilyn Marshall. + On average, courses using ALEKS had noticeably higher pass rates than non-ALEKS courses. + For example, there was an 11\% increase in pass rates in on-campus ALEKS classes in Fall 2012 compared to non-ALEKS Fall 2011 classes. + Both on-campus and DL classes showed increased passing rates using ALEKS. + In addition, a few students each term were able to complete two courses during one term, finishing Basic Mathematics early and then successfully completing MTH 60. + + \item[MTH 112: Elementary Functions] ALEKS was incorporated into one Elementary + Functions section and compared with two traditional sections, all taught by + faculty member Tammy Louie. + In this small sample, both the grade distribution and pass rates were similar. + However the student retention rate in the ALEKS class was 17. + 3\% higher than in the non-ALEKS classes. + +\end{description} + +In both pilots students were observed to enjoy using ALEKS and increase their study time while using ALEKS. +More detailed data can be found in the \vref{app:sec:aleks} concerning both pilot projects. +These pilots of ALEKS had noticeable success with student perception and involvement. +Further exploration of ALEKS technology should be pursued as a possible option to improving student success in mathematics courses. + +\subsection{MTH 112 formula sheet} +The SAC approved a standardized ``formula sheet'' for use in MTH 112. +Math SAC member Wendy Fresh revised and submitted a formula sheet edited from one provided by SAC member Pete Haberman. +The page was added to the course CCOGs to help guide instructors and clarify evaluation expectations. + +\subsection{MTH 212 proficiency exam} +With SAC approval, the MTH 211--213 instructors added a basic skills proficiency exam to MTH 212 that must be passed with no less than a 90\% in order to pass the course. +MTH 212 is the second of a three part series of courses for students preparing to enter a teacher education field. +The proficiency exam covers basic operations on integers, fractions, decimals, and percents. +Although there is a MTH 95 prerequisite for the MTH 211--213 series, many of the students do not remember these basic operations. +Since these are topics covered in MTH 212, it was felt that holding the students responsible for the basic skills would help them grasp the concepts with more success. +This approach has been adopted by several of the Oregon community colleges and four-year universities that offer the MTH 211--213 sequence. + +\subsection{Casio Classpad} +The SAC approved of the Casio Classpad as an additional recommended graphing calculator in MTH 95 and Lower Division Transfer courses. +In addition, the CCOG for MTH 93, the one-credit graphing calculator class, was revised to reflect topics specific to the Casio Classpad. +Faculty members Tammy Louie and Alex Jordan created a PCC-specific user guide for the Classpad, which is available for download (along with earlier PCC calculator manuals) at the math department web site \cite{pccmathdept}. + +\subsection{Piloting of DE courses geared to a specific subset of CTE students} +In 2009, Choul Wou, a Perkins advisor, asked Michele Marden collaborate with her to create a reference document to support CTE students in the Building Inspection, Interior Design, Architecture, and Drafting programs. +There was a particular need to bridge from MTH 65 coursework to ARCH 122. +Michele observed an ARCH 122 section and a document was created. +Soon after, Michele was approved to teach two sections of MTH 60 and one section of MTH 65 reserved for CTE students in the programs stated above. +The course focus was limited by the requirements of the CCOGs, but whenever possible, material was geared to support the mathematical needs for these programs. +This experience led to the awareness that the reference document needed significant revision; however, due to the development of CTE-focused courses, the reference document was not updated. +The specialized courses were discontinued due to lack of enrollment. + diff --git a/test-cases/oneSentencePerLine/pcc-program-review4-mod2.tex b/test-cases/oneSentencePerLine/pcc-program-review4-mod2.tex new file mode 100644 index 00000000..11ff21d4 --- /dev/null +++ b/test-cases/oneSentencePerLine/pcc-program-review4-mod2.tex @@ -0,0 +1,682 @@ +% arara: pdflatex: {files: [MathSACpr2014]} +% !arara: indent: {overwrite: yes} +\chapter{Other Curricular Issues}\label{chap:otherissues} +\epigraph{Education is the only business still debating the usefulness of + technology.}{Rod Paige, former U. + S. + Secretary of Education (2002)} \section[Distance education]{To what degree are courses offered in a Distance modality (online, hybrid, interactive television, etc.) + ? + For courses offered both via DL and on-campus, are there differences in student success? + (Contact the Office of Institutional Effectiveness, either Laura Massey or Rob Vergun, for course-level data). + If so, how are you, or will you address these differences? + What significant revelations, concerns or questions arise in the area of DL delivery? + }\label{other:sec:distancelearning} + +The Math SAC offers Distance Learning (DL) courses in online, hybrid, and interactive television (ITV) modalities. +We strive to make our DL course experience simulate the face-to-face course experience with respect to instructor presence, feedback, and assessment. +We use discussion boards to simulate the classroom learning environment, and an array of online homework platforms to assess and prepare our students effectively. +A Math SAC DL standing committee is charged with discussing the structure of our current DL courses, as well as developing and maintaining current DL best practices and standards. + +\subsection{Presence of DL offerings} +All of our pre-college level math courses (except a calculator skills course) have a DL offering, as do most of our lower-division collegiate courses. +Courses that are not offered using a distance modality fall into two categories: those on the high end of our collegiate courses, and specialty courses with low enrollments; \cref{tab:sec3:DLofferings} shows complete details. + +\begin{table} + \caption{Course Offerings through Distance Learning}\label{tab:sec3:DLofferings} + \centering + \begin{tabular}{ccccccccc} + \toprule + \multicolumn{3}{p{1in}}{Offered as DL} & \multicolumn{3}{p{1in}}{Not offered DL upper division} & \multicolumn{3}{p{1in}}{Not offered DL specialty} \\ + \midrule + 020 & 030 & 060 & 251 & 252 & 253 & 015 & 25C & 26C \\ + 065 & 070 & 084 & 254 & 256 & 261 & 061 & 062 & 063 \\ + 095 & 111 & 112 & & & & 093 & 105 & 211 \\ + 241 & 243 & 244 & & & & 212 & 213 \\ + \bottomrule + \end{tabular} +\end{table} + +Approximately 14.1\% of PCC math enrollments were DL based during the academic year 2012/13 compared to only 9.1\% in the 2007/08 academic year. +This percentage increase is coupled with a general enrollment surge over the past five years, and the number of DL enrollments has grown by over 150\% in this time period. +\Cref{fig:sec3:DLenrollments,fig:sec3:F2Fenrollments} show student enrollment in face-to-face courses compared to online courses over six academic years. +Note that even while overall enrollment has declined some since its peak in 2011/12, that absolute enrollment in DL courses has still grown. +\Cref{tab:sec3:F2FandDLdata2007,tab:sec3:F2FandDLdata2010} give more detailed data---note that we do not offer classes above MTH 244 in a DL modality. + +\begin{figure}[!htb] + \begin{minipage}[t]{.5\textwidth} + %\includegraphics[width=\textwidth]{graphics/enrollmentInDL.pdf} + \input{graphics/enrollmentInDL.tex} + \caption{Enrollments in DL}\label{fig:sec3:DLenrollments} + \end{minipage} + % + \begin{minipage}[t]{.5\textwidth} + %\includegraphics[width=\textwidth]{graphics/enrollmentInF2F.pdf} + \input{graphics/enrollmentInF2F.tex} + \caption{Enrollments in face-to-face classes}\label{fig:sec3:F2Fenrollments} + \end{minipage} +\end{figure} + +\begin{table}[!htb] + \begin{widepage} + \centering + \caption{DL \& Face-to-face (F2F) enrollments and pass rates 2007--2010} + \label{tab:sec3:F2FandDLdata2007} + \input{tables/dlvsF2FenrollPass2007-2010.tex} + \vspace{2pc} + \caption{DL \& Face-to-face (F2F) enrollments and pass rates 2010--2013} + \label{tab:sec3:F2FandDLdata2010} + \input{tables/dlvsF2FenrollPass2010-2013.tex} + \end{widepage} +\end{table} + +As enrollment demand for DL math courses has increased, we have increased the number of sections that we offer and trained more interested faculty in managing DL courses. +Between the academic years of 2003/04 and 2007/08, the annual number of sections offered increased from 51 to 87. +In the 2012/13 academic year, we offered 185 DL sections. +The resulting increase in sections offers access to students that can succeed in this modality and need this option due to outside constraints such as work and family. + +\subsection{Success rates in DL courses} +Pass rates in DL courses are quite noticeably lower than those for their face-to-face counterparts; \cref{fig:sec3:F2FandDLpassRates} visualizes the difference in pass rates between the highest enrollment DL courses that we offer and their face-to-face counterparts. +More detailed data for all DL offerings can be seen in \cref{tab:sec3:F2FandDLdata2007,tab:sec3:F2FandDLdata2010}---see also \vref{app:sec:dlsuccess}. +We recognize that students need a certain level of self-discipline, better study skills, and comfort engaging with technology to succeed in a DL course. +However we currently have no method for screening which students are less likely to succeed using a distance modality; our recommendations on \cpageref{other:sec:recommendations} attempt to address this issue. + +Referencing \cref{fig:sec3:F2FandDLpassRates}, it is clear that, in the six academic years shown, the pass rates generally decrease regardless of delivery mode. +We hypothesize that this overall trend is mostly the result of the economic collapse of 2008 which led to increased enrollment and changes in our student demographics (see demographics data in \vref{app:sec:demographicdata}). +But the pass rates in DL courses are as much as 30\% lower than in face-to-face counterparts and this large discrepancy needs to be addressed. + +\begin{figure}[!htb] + \begin{widepage} + \begin{subfigure}{.3\textwidth} + \input{graphics/passRatesByModality020.tex} + \captionof{figure}{MTH 20} + \end{subfigure} + % + \begin{subfigure}{.3\textwidth} + \input{graphics/passRatesByModality060.tex} + \captionof{figure}{MTH 60} + \end{subfigure} + % + \begin{subfigure}{.3\textwidth} + \input{graphics/passRatesByModality065.tex} + \captionof{figure}{MTH 65} + \end{subfigure} + + \vspace{2pc} + + \begin{subfigure}{.3\textwidth} + \input{graphics/passRatesByModality095.tex} + \captionof{figure}{MTH 95} + \end{subfigure} + % + \begin{subfigure}{.3\textwidth} + \input{graphics/passRatesByModality111.tex} + \captionof{figure}{MTH 111} + \end{subfigure} + % + \begin{subfigure}{.3\textwidth} + \input{graphics/passRatesByModality243.tex} + \captionof{figure}{MTH 243} + \end{subfigure} + \caption{Pass Rates By Modality} + \label{fig:sec3:F2FandDLpassRates} + \end{widepage} +\end{figure} + +The difference in student-success rates between on-campus courses and DL courses is an important issue for the Math SAC. +The Distance Learning Standing Committee has met to consider this issue and the factors that lead to this difference in success rates. +We can only speculate the reason for the disparity based on anecdotal evidence and professional experience. +Students may no longer see DL courses as unusual, so they may be unaware that successful DL math students should have stronger study skills, self-discipline, and time management skills than face-to-face math students absolutely need to be successful. +We believe that many students register for DL math courses without adequate understanding of the study habits, time commitment, learning styles, and technical skills that are necessary for success in these classes. +Anecdotal evidence suggests that some students who are aware of these issues and who would otherwise enroll in a face-to-face section still enroll in a DL section due to a lack of space in face-to-face sections. + +There is currently a DL orientation available for DL students, but there is no requirement that students complete it. +Furthermore, there is no information in the orientation to help students understand the particular challenges of studying \emph{mathematics} using the DL delivery methods. +In many disciplines, reading, writing, and discussion can be sufficient for learning. +Students in mathematics typically do not learn best until they have also acted, by working through exercises or active problem solving. +In face-to-face classes, instructors can monitor that this learning-through-action is happening more easily. +In DL courses, there is more of a need for students to rely on self-discipline to complete this portion of their learning, and this is not communicated in the existing DL orientation. + +\subsection{Informing DL students} +The Course Information Page (CIP) is accessible to students registering for DL courses and is meant to give section-specific information to students as they decide which sections to register for. +Many faculty members use this system to inform students of issues related to an online mathematics course. +For example, faculty address the misconception that a DL class requires fewer hours of attention per week than a face-to-face class. +We believe that many students do not visit the CIP for DL classes and continue to be unaware of the tools they will need to be successful in a DL mathematics course. +Some faculty members send emails to registered students before the term starts, asking them to read the CIP; it is not clear, however, how many students read this email or act on it. +The link to a CIP is only available via the online class, and not via MyPCC; this lack of presence may contribute to the issue. + +Other methods that are employed by DL faculty to directly communicate with their students include: +\begin{itemize} + \item using the Course Progress Notifications (CPNs); + \item placing telephone calls to students; + \item using Collaborate to hold online office hours in a kind of visual and aural chat session. +\end{itemize} + +\subsection{Online homework platforms} +Faculty have sought to increase engagement by DL students through use of online homework platforms. +An online homework platform can provide students with immediate feedback and also hold the student accountable for completion of assigned exercises. +Faculty can monitor progress and employ formative assessment from a distance. + +The SAC recognizes that program changes should come from research toward best practices. +Faculty members Wendy Fresh, Rebecca Ross, Tammy Louie, Jessica Bernards, and Diane Edwards have investigated the effects of use of an online homework system in several experiments in both DL and face-to-face courses. +In most cases, results from these experiments suggest there may be positive effects to using an online platform, but it remains too early to declare statistical significance. +To demonstrate statistical significance in studies of this nature requires considerably large sample sizes. + +However Jessica Bernards has been able to measure one positive effect to a significant degree. +Instructor Bernards taught several online sections of MTH 111, with control groups doing homework from the textbook and submitting paper write-ups, and experimental groups using online homework. +The withdrawal rate was 32\% for the control group and only 16\% for the experimental group, and this difference was statistically significant ($P<1\%$). +Instructor Wendy Fresh ran a very similar experiment with online sections of MTH 60. +There may still be an effect at that level, but more data is necessary to confirm with statistical significance. +Both instructors noted modest improvement in exam scores among the experimental group, but again more data is being gathered to confirm with significance. + +For more information on research by Instructors Bernards and Fresh for DL courses, see \vref{app:sec:onlinehwstudy}. +For information on research by instructors Edwards and Louie, see \vref{app:sec:aleks} and also \cpageref{sec3:subset:alekspilot}. +Research on the efficacy of WeBWorK (an online homework platform discussed on \cpageref{other:sec:webwork}) was done in \cite{focuswebwork}. +In \cite{brewer} it was found that when students are segregated by incoming ability, those who were less prepared when entering a course do benefit significantly from online homework use. +As a community college, we have more under prepared students than universities, so this finding suggests that use of online homework may be more helpful at PCC. +It is important to note that each of these studies were done with face-to-face courses; in DL courses the traditional homework alternative presents the challenge of delivery, complicating the question in favor of using online homework. + +\subsection{WeBWorK}\label{other:sec:webwork} +Recent exciting developments at PCC have centered around the free and open-source online homework platform called WeBWorK that is partially funded by the National Science Foundation and maintained by the Mathematical Association of America. +By Spring 2014 we expect that over 20 faculty will be using WeBWorK in their courses. +The Math SAC is also loaning out the services of Alex Jordan to CTE and LDC science SACs to create free online homework review programs. +We envision using WeBWorK for future Learning Assessment research and placement advising. +We are working with Dual Credit instructors to offer WeBWorK services to Portland Public Schools. + +Most of the textbooks currently in use by the Math SAC are published by Pearson Publishing, which offers MyMathLab for its online homework platform. +While MyMathLab and similar commercial products come as a bundled expense with new textbook purchases, a separate online account for pairing with a used textbook purchase is rather expensive. +For this reason, face-to-face instructors rarely require MyMathLab in their courses. +On the other hand, Distance Learning instructors have a stronger need for an online homework platform and the majority of DL instructors do require that students use (and pay for) MyMathLab. + +By contrast, WeBWorK is a platform for online homework that is free and open-source. +As there is no central headquarters for WeBWorK, it must be installed on a server somewhere. +Since joining the Math SAC in Spring 2009, Alex Jordan has championed the implementation and use of WeBWorK at PCC. +Some PCC math faculty have used WeBWorK in various capacities by borrowing server space from the University of Oregon, a relationship formed and maintained by Jordan. +This partnership between two Oregon state institutions has been mutually beneficial. +While PCC gained server access, PCC faculty members were programming content that the University of Oregon has been able to take advantage of. +Each term since Fall 2011, roughly 10 sections of PCC math courses have used the UO server. + +Over this period, WeBWorK users in the Math SAC lobbied Technology Solution Services to provide the Math SAC with its own WeBWorK server. +While the UO server provided service to us, it came with certain restrictions and complications that prevented WeBWorK at PCC from reaching its full potential. +For a time there was a chicken-and-egg situation, as TSS requested a greater usage by PCC faculty before arranging for a server while some faculty chose not to use WeBWorK because of the inconvenience of using the UO server. + +In the 2012/13 academic year, faculty Chris Hughes and Scot Leavitt researched accessibility issues (in the ADA sense) alongside Disability Services. +See \cite{accessibilityproject} for the full report. +Among many other findings, they found that MyMathLab (at the time of the project) had many significant accessibility problems while WeBWorK was quite close to being fully ADA compliant. +The open-source nature of WeBWorK meant that the few remaining obstacles to accessibility could be addressed. +They recommended that the SAC cease using MyMathLab for newly developed courses and newly developed online shells. +They also recommended that faculty migrate from MyMathLab to WeBWorK. +Disability Services supported their recommendations, and also began lobbying TSS for a PCC WeBWorK server. +Within the WeBWorK community PCC is now seen as a leader when it comes to accessibility issues. +See \cite{webworkblog} for a post about this on the WeBWorK news blog. +As a result of this, PCC is hosting a WeBWorK development camp in August 2014 with a central theme of addressing accessibility issues and enhancing its accessibility. +\label{other:page:disabilityservices} + +TSS partnered with the Clackamas Education Service District to deliver a WeBWorK server that has been fully implemented since Winter 2014. +SAC members Alex Jordan, Chris Hughes, and Xiaolong Yao have prepared \href{http://webwork.pcc.edu}{webwork.pcc.edu} for regular use starting Winter 2014 term. +A backup server at \href{http://webwork-dev.pcc.edu}{webwork-dev.pcc.edu} is in place for faculty to experiment with. + +The arrival of our own WeBWorK installation has significant implications beyond homework management, particularly in the advising department. +We envisage that advisors would enroll students in a `review course' that contains (mostly) pre-college practice problems, and that the student would be encouraged to sit the COMPASS placement test only when they are comfortable with the problems in WeBWorK. +Furthermore, we can easily use WeBWorK as an advising tool to replace Hughes' Placement Advisory Test (\cite{mathprogramreview2003}, pages 12--13) in situations when students are not happy with their placement from COMPASS. +The SAC should work with advising to implement this. + +\subsection{PCC WeBWorK problem library} +WeBWorK has been in use at universities for some time now, and an extensive library exists of math problems for college level courses. +However there was weak content support for basic algebra and other pre-college topics. +Over Summer 2013, Alex Jordan, Chris Hughes, and Xiaolong Yao oversaw an effort to create a library of high-quality, algorithmically generated, basic algebra WeBWorK exercises which was partly funded with an IIP development grant; they received support from math instructors Kandace Kling, Debbie Neft, Jeremy Shaw, and Danielle Rice. +These exercises currently cover topics from MTH 60 and 65, and the team continues to add problems to the library for MTH 95. +The library development was a success because of the strong collaboration and dedication of the three faculty members, and the foundations that Jordan had laid in previous years. +Jordan, Hughes, and Yao presented their work at the STEM showcase (Rock Creek) in Fall 2013 (see \cref{webworkposter}). +It was at this showcase that the idea was hatched to create free online homework review programs for CTE and LDC science SACs. + +\begin{figure}[!htb] + \centering + \includegraphics[width=0.5\textwidth]{webworkposter} + \caption{WeBWorK poster from the PCC STEM Showcase}\label{webworkposter} +\end{figure} + +As time and funding progress, SAC members with the requisite coding experience hope to add more problems to this PCC library, expanding into the arenas of MTH courses 20, 111, 112, 243, and 244. +It is important to note the level of quality of the problems from this library. +Each problem has a full walk-through solution coded along side the question which can be put to use by faculty in a number of ways. +Each problem is given fine attention to detail so that automated feedback messages to the students are as informative as modern technology can allow. +This high level of quality requires time and experience to achieve. +However it is necessary if any instructor hopes to use WeBWorK as a teaching tool and not just an assessment tool. + +\subsection{Concerns about DL offerings} +Each of the following three issues have been raised by SAC members, and during the 2012/13 academic year a group of concerned faculty met to discuss them. +The meetings were informal and no binding decisions were reached. +\begin{itemize} + \item Faculty are concerned about whether or not Distance Learning is an effective way to deliver math content, especially in light of the low pass rate statistics seen in \cref{fig:sec3:F2FandDLpassRates}. + Successfully learning mathematics generally requires heavy active engagement. + Face-to-face courses facilitate this engagement by requiring students to be in the physical presence of their instructor and fellow students. + In DL courses, the imperative to remain engaged must come mostly from the student's own sense of responsibility and interest. + \item Faculty are concerned about the quality and consistency of current DL courses. + Some faculty rely on publisher content such as electronic versions of textbooks, while other faculty have created complete sets of online notes themselves and use e-books only as secondary resources. + Instructor Chris Hughes serves as an advisor to online faculty creating new courses, and makes recommendations to improve course quality and observe accessibility standards. + However there is no enforcement of the online advisor's recommendations. + \item Faculty are concerned about the portion of a student's grade that may be computed from online homework. + Compared to traditional homework, online homework is more readily vulnerable to cheating. + With many math exercises, the exercise can literally be typed in to Google and the search engine itself provides an answer. + Online homework provides fewer obstacles for a dishonest student to employ someone else to do their homework for them. + In fact, in Craigslist sites nationwide, all one need do is search for `mymathlab' to find advertisements from those who will `take your online math course for you' at a cost. + The Math SAC has always wanted its online courses to mirror its face-to-face courses, and as a consequence has never created CCOGs that treat face-to-face and online courses differently. + This has made it difficult to place any cap on the portion of a grade that may be computed from online homework. + There is also no consensus on what an appropriate cap would be. +\end{itemize} + +\subsection{Recommendations}\label{other:sec:recommendations} +Our main recommendations concern how to best inform students about the particular skills that a distance learning student should have or adopt in order to be successful. +We also recommend enacting some prerequisite items for DL registration to help give these skills to students. +Lastly there are some recommendations that do not fit these descriptions. +Many of these recommendations hold for face-to-face courses as well, and may be repeated elsewhere in this program review. +\begin{description} + \item For the Math SAC: + \begin{itemize}[label={}] + \item \recommendation[Math SAC]{Consider how the quality of online courses could be improved by more effective regulation by the SAC. + } + \end{itemize} + \item For Administration/Advising: + \begin{itemize}[label={}] + \item \recommendation[Math SAC, Distance Learning, Advising]{Advising and the Math SAC should collaborate to implement a WeBWorK-based review mechanism for would-be placement test takers.} + \item \recommendation[Math SAC, Distance Learning, Advising]{Give students more information on DL responsibilities and make students aware of the difference in student-success statistics between DL and face-to-face courses.} + \item \recommendation[Math SAC, Distance Learning, Advising]{Encourage students to contemplate why they seek to take a DL course and reflect upon whether it will align well with their learning style and personal skill sets.} + \end{itemize} + \item For Administration/DL/TSS: + \begin{itemize}[label={}] + \item \recommendation[Distance Learning, TSS]{Have the online orientation linked from the registration tool in MyPCC and require that students complete this orientation before registering for a DL class.} + \item \recommendation[Math SAC, Distance Learning, Advising]{Include a section in the DL orientation that addresses the specific challenges that DL brings to mathematics courses. + Perhaps only students seeking to register for a mathematics DL course would be required to complete this section.} + \item \recommendation[TSS]{Add redundant access to the Course Information Page. + Along with access through the online Class Schedule, the CIP could be available through MyPCC on the home page for a course and through Desire To Learn.} + \item \recommendation[Math SAC, TSS]{Include a pop-up or hover-over window that is activated when a student tries to register for a DL MTH class that gives specific information about the challenges of DL Math courses. + } + \end{itemize} + \item For Administration/Other: + \begin{itemize}[label={}] + \item \recommendation[Math SAC, Curriculum Committee]{Require students to demonstrate pre-requisite computer literacy skills such as those taught in basic internet skills (CAS 104), beginning Word (CAS 216), beginning keyboard (CAS 121), and basic computer skills/MS Office (CAS 133).} + \item \recommendation[CAS SAC]{Develop and require a basic DL/computer skills competency course, possibly offered during week 0 of the term. + } + \item \recommendation[Math SAC, Division Deans, Deans of Instruction]{Provide opportunities for faculty professional development in research + design and data analysis to help with research efforts on the efficacy of + online homework.} + \item \recommendation[Math SAC, Division Deans, Deans of Instruction, Advising, Completion Investment Council]{Provide + support for further development of WeBWorK related projects, + including a larger library of math problems for courses beyond 60/65/95, + enhancements of the WeBWorK engine, and content for placement advising/review.} + \end{itemize} +\end{description} + +\section[Curricular changes resulting from educational initiatives]{Has the SAC + made any curricular changes as a result of exploring/adopting educational + initiatives (e.g., Service Learning, Internationalization of the Curriculum, + Inquiry-Based Learning, Honors, etc.)? + If so, please describe.}\label{cur:sec:curchange} + +The Math SAC has made numerous substantial changes to its curriculum. +Those that are based in exploring or adopting educational initiatives are listed here. +More changes to the math curriculum are discussed in \vref{cur:sec:other}. + +\subsection{MTH 111H College Algebra: Honors}\label{cur:sub:111H} + +The course has been offered only at Sylvania campus---Winter 2012 (12 students), Winter 2013 (22 students), Spring 2013 (15 students), and Fall 2013 (17 students). +Ronda Lively was the instructor the first three terms, which allowed her to evolve her materials and activities. +Ann Cary taught the Fall 2013 term, and has collaborated closely with Ronda Lively. + +The honors course must cover the same material as the regular course. +It is stressed that honors versions of a course should not be ``harder'', but different in the use of class time and activities/assignments. +There should also be a component of Community and Environmental Responsibility, which is a PCC Core Outcome that is usually difficult to place in math courses. +Instructor Lively regularly teaches MTH 111 and MTH 111H during the same term. +The same exams were given in both courses. +There were differences in the other evaluation criteria used in the courses. +In the MTH 111 class, students submitted take home graded worksheets and participated in an in-class graded group activity. +The evaluation of the students in the MTH 111H class included: +\begin{itemize} + \item a collaborative computer project involving math history and investigation of several applications of math; + \item a team quiz-grading activity where each group wrote a key and grading rubric, then applied it to two (fictional) students' quizzes; + \item a community tutoring project: over several weeks, each student found someone to tutor in math (friend, neighbor, family member, \ldots) and then wrote a paper on their experience. +\end{itemize} +Since the overall student ability level was high, there was time in class to investigate other topics of interest related to college algebra. +Each term there were several students that enrolled because of the time slot, not because they were strong in math. +Encouragingly, the stronger students took the less prepared students under their wings and helped them to be successful. + +\subsection{Social justice workgroup}\label{cur:sub:socialJustic} +A Math and Social Justice workgroup was formed by Ann Cary and Emiliano Vega in response to a national convention they attended. +The group has collected and disseminated data sets and activities to participating math instructors and has gained interest and participants from other disciplines at PCC, as well as area high school math instructors and community activists in Portland. +More importantly, the group has the focus of providing a forum on how to discuss potentially sensitive subjects in a classroom setting when using application problems and how to be more culturally and socially aware of individual students and classes. +The information they gathered has improved the pool of activities and application problems available, improved the ability of instructors to work effectively with the broad demographic of students and co-workers, and also continues the college's focus on two Core Outcomes: Community and Environmental Responsibility and Cultural Awareness. +For a sample of material from this workgroup, see \vref{app:sec:socialJustic}. + +\subsection{Service learning}\label{other:sec:servicelearning} +Service Learning has been a part of many math instructors' courses at PCC, but has been deepened through the Service Learning website which includes additional resources and syllabi submitted by participating instructors at PCC. +In addition, Service Learning will be added to some CCOGs evaluation criteria to encourage instructors to incorporate Service Learning in their math classes. +Jeff Pettit participated as an observer in the Service Learning training cohort at Sylvania campus, connecting with instructors in other disciplines and gaining an understanding of how Service Learning is employed in other courses. +This has led to new curriculum in his Statistics courses and upper-division courses where Service Learning was not originally employed. + +\subsection{Developmental Education math study group} +A new committee was formed by the SAC to address developmental math completion rates. +The committee is researching the feasibility, cost and difficulty associated with implementing ``pathways'' beyond the current calculus focused MTH 60--95 courses. +The committee is considering options for employing career-based math course series and a statistics-based math course series. + +\subsection{Placement test reform group}\label{other:sec:placementreform} +A committee has been formed to address placement test reform. +The group intends to better measure students' needs beyond the current math-skills COMPASS test. +We hope to find a way to measure key traits and needs of students to connect student populations with the support needed to better guarantee success. +% I had encouraged these guys to work with student services, who are also +% addressing these concerns. I don't know if they are or not though. I do +% know that student services is working with the NSF Grant proposal team on +% these issues. Perhaps a little more should be said here? + +\section[Present dual credit relationships]{Are there any courses in the program + that are offered as Dual Credit at area High Schools? + If so, describe how the SAC develops and maintains relationships with the HS faculty in support of quality instruction. + Please note any best practices you have found, or ideas about how to strengthen this interaction. + } + +During the 2012/13 academic year, PCC dual credit was awarded for seven mathematics courses. +Classes were offered at seven high schools and there were a total of twelve instructors certified to teach PCC dual credit mathematics classes. +There were a total of 750 unduplicated students who enrolled in at least one PCC dual credit mathematics class and collectively those students earned 6032 mathematics credits through PCC. +In Fall 2012, an ad hoc committee was formed in the mathematics SAC to investigate the status of our dual credit program. +The formation of this committee was prompted, in part, by the discovery that several of the posted dual credit syllabi described courses that bore little resemblance to the course for which students were earning PCC credit. +The committee decided that the root cause of this disconnect was a lack of robust support on our part. +Three concrete actions were taken to address the disconnect: +\begin{itemize} + \item Each dual credit mathematics instructor was assigned a team of two support faculty from the mathematics departments at PCC. + Each pair of support faculty visited their assigned instructor at that instructor's high school. + These meetings were rather informal; the intent being to establish a concrete support team for each high school instructor. + \item A two-day mandatory summer workshop was organized by the committee in conjunction with Beth Molenkamp, who at that time was the coordinator of PCC's dual credit program. + At the workshop each dual credit instructor was tasked to complete a robust (and accurate) syllabus for each of their dual credit classes. + The PCC faculty helped with this task and all of the dual credit instructors now have syllabi that truly reflect the nature of the course for which the students are earning PCC credit. + The remainder of the workshop was spent sharing resources and pedagogical tactics used by various PCC faculty in the courses for which dual credit is also offered. + \item A Google Drive site was created to share resources. + Although the inspiration for this site was to give our dual credit faculty easy access to shared resources, the pooling of resources is obviously of great benefit for PCC faculty as well. +\end{itemize} + +\section[Future dual credit relationships]{Does the SAC plan to develop any + additional Dual Credit agreements with area high schools? + If so please describe. + If not, what does the SAC see as barriers to developing further dual credit agreements. + } +Students at Central Catholic High School will get their first opportunity to earn PCC mathematics dual credit during the 2013/14 academic year. +This adoption was coordinated through the dual credit program; that is, the Math SAC played no active role in the creation of this dual credit agreement. + +There is concern in the mathematics SAC that the state's 40-40-20 initiative, and the accompanying bills aimed at encouraging high school students to earn college credits, might lead to a dramatic increase in the number of high schools offering dual credit for mathematics courses. +The greatest challenge is that there are not that many high school mathematics instructors who meet PCC's qualifications to teach post-100 level mathematics courses. +We are concerned that the day might come where we are pressured to lower those standards or, of even more concern, we are pressured to start awarding PCC dual credit for developmental mathematics courses (MTH 95 or below). + +\subsubsection{Addendum} +As feared, we are now being asked to allow high school instructors who do not satisfy minimum qualifications to teach transfer level courses. +As currently proposed, a high school instructor who does not meet minimum qualifications would be paired with an ``instructor of record'' who does meet the qualifications. +There is also a possibility that after a time the high school instructor will be deemed to have ``demonstrated competency'' and will at that point be allowed to become the instructor of record based upon that criterion. +We are concerned by this proposal on many levels. + +The first is fundamental: this proposal undermines our established ``minimum qualifications. +'' +While we realize that the pressure to make these changes originates from the State of Oregon and other outside parties, we +need to be mindful that our accreditation is also at stake. + +Additionally, there are fears that the concept will seep into the manner in which we staff classes on our own campuses; an alternative minimum qualification such as ``demonstrated competency'' cannot be exclusive to teachers in the high school classrooms. + +Finally, if the concept takes off at the dual credit level, there are serious workload concerns for the faculty at PCC. +The title of ``instructor of record'' comes with a serious amount of responsibility and accountability; authentic and ongoing involvement in these courses will require time from a faculty that is already stretched for time. +We are presently being asked to revamp our entire DE curriculum (and are actively involved in that pursuit), and adding increased dual credit involvement to our list of duties will take away time from that agenda. +Priorities need to be established. +If the college chooses to pursue this change in dual credit policy we hope that the changes are instituted in a manageable and reputable way. + +\section[Other significant curricular changes]{Identify and explain any other + significant curricular changes that have been made since the last + review.}\label{cur:sec:other} + +The industrious Math SAC has made numerous changes to its curriculum that stemmed from a variety of sources other than broad educational initiatives. +(Curricular changes stemming from broad educational initiatives are discussed in \vref{cur:sec:curchange}.) +These changes often arose from the perceived needs of our students, innovative ideas from our faculty, evolutions in technology, administrative restructuring, and good old-fashioned housekeeping. + +\subsection{MTH 20 moved to the Math SAC from the DE SAC} +The MTH 20 curriculum was moved into the Math SAC from the DE SAC in Fall 2012, bringing all math curriculum under the same SAC. +This move was meant to help create consistency in the CCOGs across the spectrum of math courses, as well as ensure that the MTH 20 curriculum is adequately preparing students for the next math course. + +Sylvania Campus, which had a separate DE Math department altogether, transitioned its DE Math instructors into the Math Department in Fall 2013. +A Math Integration Work Group was formed and charged with creating a seamless path for this transition. +With the DE Math instructors in the Math SAC and the current college focus on success in pre-college math courses, the Math SAC's focus is on producing high-yield instructional practices, student success, and completion across the span of math courses offered by the college. + +\subsection{MTH 20 proposed credit change: 4- to 5-credit}\label{cur:sub:mth20} +MTH 20 (Basic Math) is a content-heavy course that covers topics such as fractions, decimals, signed number operations, geometry, proportions, and percents. +It can be argued that the amount of material covered in MTH 20 is greater than in any of our other mathematics courses. +At times, instructors are forced to either minimize required topics or occasionally cut them entirely due to time constraints. +Because of this, for years many MTH 20 instructors have wanted to increase the number of credits for the course. + +In October 2012, the SAC received a memo from the DOIs related to class sizes in which we were encouraged to consider converting MTH 20 from 4- to 5-credits; a subcommittee was formed by the SAC to investigate the benefits and consequences of increasing the number of credits. +The committee looked into the financial aid impact on students, the impact on degree/certificate programs, and the impact on classroom availability. +It also rewrote the CCOG to include study skills and increase the emphasis on reading graphs and geometry in the course. + +In April 2013, the Mathematics SAC approved the conversion of MTH 20 from a 4-credit course to a 5-credit course. +The conversion was then approved by the Curriculum Committee in November 2013. +Unfortunately, the current DOIs denied the recommendation in late November 2013; since the original recommendation came to the Math SAC in 2012, the college leadership has changed at many levels, and with these changes have come changes in perspectives and goals for the math curriculum. +The Math SAC is currently engaged in reevaluating and reorganizing pre-college level math at all levels; it is highly likely that the first course will require 5 credits for optimal student success. + +\subsection{MTH 60/65/70/95 curriculum alignment} +The Math SAC recognized that students successfully completing MTH 65 often had difficulty passing MTH 95. +The same was true for students transitioning between MTH 95 and MTH 111. + +It was thought that creating more continuity between the MTH 60/65 series and MTH 95 would improve student success. +To this end, during 2008/09, a committee was created to redesign the 60/65/95 curriculum with an eye toward carefully preparing students for the rigor of college level mathematics. +While MTH 60, MTH 65 and MTH 95 had been traditionally taught as algebraically focused classes, the committee adjusted the curriculum to reflect the need for students to be able to understand mathematical information via the `rule of four': algebraically, graphically, numerically and verbally. +This was done to prepare students for the demands of college level math and to align with the best practices of our field. +Importance was also placed on the use of a graphing calculator in MTH 95 to aid in this. +These changes were also reflected in the intermediary course in the MTH 60/65/95 series: MTH 70. + +As with all curricular changes, there continues to be a need for ensuring that all of the instructors receive the necessary communication and support in implementing these changes. +This is especially true for the part-time instructors who are teaching a large proportion of the MTH 60--95 courses. +However, with the nature of the part-time instructor's working conditions, this continues to be a challenge. +The Math SAC requests more support from the administration to provide the necessary funding for part-time instructors to attend course-specific meetings similar to the one held for MTH 95 instructors at the Sylvania Campus prior to the Fall 2013 term. + +\subsection{Replaced MTH 111A/111B/111C with MTH 105 and MTH 111} +In 1997 the Math SAC split MTH 111 into three courses in order to target different student populations: MTH 111A for liberal art students, MTH 111B for business and other non-technical majors, and MTH 111C for Science and Engineering. +In our last Program Review, \cite{mathprogramreview2003}, it was mentioned that we eliminated MTH 111A and resurrected MTH 105 (see \cite{mathprogramreview2003} page 19). +Since then, MTH 111B and 111C have merged again into MTH 111. + +The CCOGs for MTH 111B and MTH 111C had grown increasingly similar; since both were prerequisites for the same courses (MTH 243 and MTH 112), they needed to cover the same content. +MTH 111B had a reputation for being an easier course and many instructors noticed that students in MTH 112 who had taken MTH 111B instead of MTH 111C were less prepared. +Since the two courses no longer served different purposes, and were creating problems with student preparation for subsequent courses, we decided to unify MTH 111B and MTH 111C into a single college algebra course starting in Fall 2012: MTH 111. + +\subsection{MTH 243 credit change: 4- to 5-credit}\label{other:sec:mth243} +The Math SAC increased credits for MTH 243 (Statistics I) from 4-credits to 5-credits for several reasons, most of which were related to a need to increase the contact hours from four hours to five hours. +In order to address the needs of future coursework in statistics as well as sufficient coverage of material for transfer to many universities, it was essential to add more material to the 4-credit MTH 243 course. +Increasing the credit hours allowed for the necessary contact time to cover such material appropriately. + +Five contact hours allows for more integration of technology into the classroom, since these technology skills are best learned with hands-on guidance from the instructor. +Formerly, it was often difficult to have meaningful technology-oriented statistical classroom exercises due to the lack of contact time. + +The change to five contact hours also gives sufficient time to fully engage the students with critical thinking exercises and quantitative and statistical literacy discussions. + +\subsection[Creation of AMP/MTH008]{Creation of two accelerated review courses + (also referred to as the Accelerated Math Program, or AMP) MTH 07 and MTH 08} +\label{other:sec:amp} +\begin{description} + \item[MTH 07: Accelerated Basic Math Review] This course presents a review of + basic math skills and provides the opportunity for guided practice. + Topics include operations with whole numbers, fractions, decimals, proportions and percents. + + \item[MTH 08: Accelerated Introductory Algebra Review] This course presents a + brief review of basic algebra skills and provides the opportunity for guided + practice. + Topics include real number operations, manipulating linear expressions, solving linear equations, and graphing linear equations in two variables. +\end{description} + +These two courses were designed to meet the needs of the following two student populations: +\begin{itemize} + \item students who have previously learned the material and are able to test into the next level of math as a result of a brief review; + \item students who have difficulty with the materials and can work on a variety of the regular course material in advance of taking the regular course. +\end{itemize} + +Both courses are offered for one week in-between terms and are 15 non-credit lab hours. +They are taught with a combination of mini lectures and computer practice/instruction. +At the completion of each course, students retake the COMPASS placement test. +Each term a significant number of students taking these courses have placed into a MTH course above their previous COMPASS placement. + +Sections have been offered at Rock Creek, Southeast, and Cascade, with most offerings at Cascade, where the courses were initially conceived and implemented by math instructors Holli Adams and Michael Marciniak. +Data from the sections taught at Cascade Campus since 2010 can be viewed in \vref{app:sec:ampdata}. + +\subsection{Clarified CCOG requirements and addenda} +It was found that there were numerous discrepancies among different sections of the same course having different instructors regarding the material being presented. +In an effort to ensure that students completing different sections of the same course had similar mathematical competencies, the SAC determined that communicating the requirements for a course needed to be made more concise. +Also, since the curriculum had significantly changed, we wanted instructors who had previously taught the course to know about these changes. +The CCOG for each course was intentionally written more clearly and now includes specific minimum requirements for testing and grading. +In addition, each CCOG now has an addendum that clearly shows examples of what is expected in terms of content, mathematical notation and presentation as well as well-defined assessment strategies. +This practice has now been adopted for most of our CCOGs. + +\subsection{Elimination of MTH 91 and MTH 92} +MTH 91 and MTH 92 were created to address the issue of the high failure rate in MTH 95 by splitting up the content of MTH 95 into two terms. +The course sequence was discontinued after data showed that students taking MTH 91 and 92 were not successful in the subsequent course, MTH 111; it was found that after taking these slower paced classes, the students were not prepared for the speed of the MTH 111 course. + +\subsection{Changes in MTH 251--254} +The calculus series has been more strongly split into Calculus I/II and Calculus III/Vector Calculus I by requesting the publisher split the current text into two sections. +This change altered the need for Maple in MTH 251 and MTH 252. +Maple is an expensive graphing software package that students buy for one year but generally use only for Vector Calculus I. +Attaching Maple to the new second half of the book solved the issue of students losing access to it if they took more than one year to complete the Calculus series. + +\subsection{Math study skills material development}\label{cur:sub:studyskills} +Research has shown that students with strong study skills are more successful in their academic pursuits than their counterparts; however, many students entering developmental mathematics courses lack these skills. +In an effort to help students build a stronger awareness of how a successful student studies, Math SAC member Jessica Bernards from the Rock Creek Campus created a Math Study Skills program to be used in our developmental math courses. +This program consists of seven topics all relating to study skills specific to mathematics: how learning math is different, resources available for help at PCC, time management, listening and note-taking skills, how to do homework, test taking strategies, and overcoming math and test anxiety. + +Each lesson has three parts: a short video to be watched by students outside of class, a student worksheet to be completed in conjunction with the video, and an in-class discussion led by the instructor. +Additionally, each topic has quotes from successful students which help strengthen the ideas in each video. +Many math instructors across all campuses piloted the program in the Spring 2013 and are continuing to use it this Fall 2013. +For Winter 2014, fourteen DE math instructors have reported that they will be using it. +The study skills website can be found at \cite{studyskills}. + +\subsection{MTH 111/112 document project}\label{cur:sec:111/112doc} +In Winter 2010, Math SAC member Chris Hughes proposed that the SAC write its own MTH 111/112 textbook. +This idea arose from a general frustration with commercially available textbooks for this sequence. +Available books tend to fall on one end or another of a spectrum ranging from template-based and lacking in conceptual understanding to abstract and lacking in guidance for students. +We seek something with better balance. +Such a textbook could also be provided to students at a much lower cost than any commercial product. + +Initially over 10 members of the Math SAC became involved, submitting ideas and small sections of what might someday become a textbook. +As time passed, four SAC members (Chris Hughes, Alex Jordan, Ann Cary, and Steve Simonds) maintained serious interest in the project. +Piecing together earlier work from the larger group, expanding on that work, and editing, these four produced a rough draft chapter representing about 10\% of a final product. +(Given that this draft would need editing, we estimate that it represents 5\% of the work necessary for completion.) + +At this point the four remaining editors put active work on hold until some level of release time can be secured that would enable completion in a timely manner. +A completed textbook for the entire sequence could be drafted with three faculty taking one-third release time for two consecutive terms. +An additional such term would provide for peripherals such as guided lecture notes, an online homework library, and LiveScribe videos. +The progress to date can be found at \cite{mth111project}. +% Math 111 textbook, recommendations/request: I hope that this is among your +% recommendations in chapter 6? + +\subsection{Supplemental course packets} +Textbooks that the Math SAC selects for courses often have gaps when compared to the CCOGs for that course. +Supplemental course packets were created to fill in the gaps and are required for those specific classes. +These include explanations of topics not covered in the textbook as well as example problems to fully cover a topic that might be lacking in the textbook examples. +Supplemental course packets have been created for MTH 60, 65, 95, 111 and 112, and can be (freely) downloaded from the Math department's web site \cite{pccmathdept}. + +\subsection{MTH 251 lab manual} +Since the late 1990s, MTH 251 has been taught in a lecture/lab format. +From that time through the late 2000s the materials used during the lab portion of the course were frequently modified. +By 2009 the lab manual had devolved into a collection of random problems and there was simply no connection between one set of problems and the next; there also were limited central themes to any one set of problems. + +In Summer 2009 faculty member Steve Simonds rewrote the lab manual from scratch. +The problem sets were written in a deliberate way to help students develop deep understanding of key concepts covered in the course. +The majority of the problems from the prior lab manual were then shuttled to the appendix as practice problems for outside of class. +All of the practice problems were fully keyed so that the students could continue thinking about the ideas (and practicing the skills) covered in lab and then determine for themselves if they had come to reasonable conclusions. + +\subsection{MTH 105 course material flexibility} +Each math course has traditionally used the same SAC approved textbook district-wide. +The Math SAC broke from this tradition and voted to allow MTH 105 instructors to choose their own course material, provided it meets the approval of the MTH 105 CCOG committee. +Unlike other math classes, MTH 105 is not a prerequisite for other math courses, and is a terminal math course for many of our students. +Each term, the instructor selects three to five topics from a list of 17. +This allows the instructors flexibility to teach material appropriate for the student population of each class. + +\subsection{ALC math courses} +The ALC math courses are self-paced pre-college math courses\footnote{The Alternative Learning Center (ALC) was an old name for the current Sylvania Student Learning Center.}. +They are designed for students to work independently at their own pace and allow them to focus on specific topics. +Consequently, a wide range of students take these courses: students who are afraid to take a math class and want to get back into math slowly; students who failed a math class once or several times; students who feel that they placed too low on the placement test and just need a review; students who want to get through the material quickly; and international students who know the math but not the English terminology for it. +At Sylvania, the majority of students who take ALC Math are students who have failed math classes, sometimes many times. + +Historically, the ALC math courses have been offered at Sylvania Campus, housed by the Developmental Education SAC, and covered math content through MTH 65. +Since Summer 2012, they have also been offered at Southeast. +Since Winter 2013, ALC is housed in the Math SAC and, since Fall 2013, it also includes MTH 95. +For a more thorough look at these changes see \vref{app:sec:alc}. +Considerations are currently being made to find ways to have ALC Math at Cascade and Rock Creek. +Students from these campuses are already using ALC Math at Sylvania and Southeast and are undergoing the hardship of travel just so they can take these courses. + +Enrollments at Sylvania and Southeast both show that there is clearly a need for these courses. +Research done by PCC's Institutional Effectiveness on data from five years at Sylvania shows that students who complete ALC Math successfully pass their math classes at a higher rate than before taking ALC Math (see \vref{app:sec:effectivenessALC}). + +\recommendation[Math SAC, Deans of Instruction, Deans of Students, Advising, Completion Investment Council]{We recommend using the ALC + math classes as an early intervention when students fail math classes.} + +At Sylvania, for instance, some full-time advisors have familiarized themselves with the ALC math courses and suggest them to students early on. +Others send students to the Math Coordinator for further advising regarding successfully completing math classes. + +\subsection{MTH 84: Introduction to \LaTeX}\label{other:sec:mth84} +In Spring 2010, Math SAC members Alex Jordan and Chris Hughes proposed a pilot course to teach the typesetting software \LaTeX. +The experimental, one-credit course was piloted for three consecutive terms (Fall 2010, Winter 2011, and Spring 2011) and then adopted by the SAC as MTH 84. +The course was first run (as MTH 84) in Winter 2012, and has run each term since with one section per term. +MTH 84 is a one-credit pass/no-pass course. +Its modality has been DL, although the CCOG does not prevent a face-to-face version. +The course serves students and faculty alike in many areas. +\LaTeX\ is a useful tool in math, the sciences, in graphic design, and in +publishing; it can easily be used to typeset internal documents, such as \href{http://www.youtube.com/watch?v=XhduoHOYXUY}{\color{black} + Program Reviews}. + +\subsection{MTH 76 Math SAC approval} +The SAC approved the CCOG for a one-credit `Introduction to GeoGebra' course. +The course is planned to run as a pilot course in Spring 2014 and Summer 2014, with tentative approval to let it run as a permanent course Fall 2014. +The audience for the course includes PCC students, PCC instructors who wish to use it as a teaching tool, and K--12 teachers who wish to use it as a teaching tool. +The course was requested by high school teachers participating in the Dual Credit workshop in Summer 2013. + +\subsection[ALEKS pilot]{Pilot using ALEKS technology in two math courses during AY 2012/13}\label{sec3:subset:alekspilot} +ALEKS technology requires students to complete each mathematics topic successfully, keeps track of student work time, provides instant feedback, routinely assesses students and requires them to revisit previously learned material. +It allows students to study a variety of topics at a time and minimizes practice of mastered material. +Two pilots of ALEKS in MTH 20 and MTH 112 were conducted. + +\begin{description} + \item[MTH 20: Basic Mathematics] ALEKS was incorporated into six online and six + on-campus MTH 20 classes. + Data was compared to the previous year's MTH 20 classes taught by the same two instructors, Diane Edwards and Marilyn Marshall. + On average, courses using ALEKS had noticeably higher pass rates than non-ALEKS courses. + For example, there was an 11\% increase in pass rates in on-campus ALEKS classes in Fall 2012 compared to non-ALEKS Fall 2011 classes. + Both on-campus and DL classes showed increased passing rates using ALEKS. + In addition, a few students each term were able to complete two courses during one term, finishing Basic Mathematics early and then successfully completing MTH 60. + + \item[MTH 112: Elementary Functions] ALEKS was incorporated into one Elementary + Functions section and compared with two traditional sections, all taught by + faculty member Tammy Louie. + In this small sample, both the grade distribution and pass rates were similar. + However the student retention rate in the ALEKS class was 17.3\% higher than in the non-ALEKS classes. + +\end{description} + +In both pilots students were observed to enjoy using ALEKS and increase their study time while using ALEKS. +More detailed data can be found in the \vref{app:sec:aleks} concerning both pilot projects. +These pilots of ALEKS had noticeable success with student perception and involvement. +Further exploration of ALEKS technology should be pursued as a possible option to improving student success in mathematics courses. + +\subsection{MTH 112 formula sheet} +The SAC approved a standardized ``formula sheet'' for use in MTH 112. +Math SAC member Wendy Fresh revised and submitted a formula sheet edited from one provided by SAC member Pete Haberman. +The page was added to the course CCOGs to help guide instructors and clarify evaluation expectations. + +\subsection{MTH 212 proficiency exam} +With SAC approval, the MTH 211--213 instructors added a basic skills proficiency exam to MTH 212 that must be passed with no less than a 90\% in order to pass the course. +MTH 212 is the second of a three part series of courses for students preparing to enter a teacher education field. +The proficiency exam covers basic operations on integers, fractions, decimals, and percents. +Although there is a MTH 95 prerequisite for the MTH 211--213 series, many of the students do not remember these basic operations. +Since these are topics covered in MTH 212, it was felt that holding the students responsible for the basic skills would help them grasp the concepts with more success. +This approach has been adopted by several of the Oregon community colleges and four-year universities that offer the MTH 211--213 sequence. + +\subsection{Casio Classpad} +The SAC approved of the Casio Classpad as an additional recommended graphing calculator in MTH 95 and Lower Division Transfer courses. +In addition, the CCOG for MTH 93, the one-credit graphing calculator class, was revised to reflect topics specific to the Casio Classpad. +Faculty members Tammy Louie and Alex Jordan created a PCC-specific user guide for the Classpad, which is available for download (along with earlier PCC calculator manuals) at the math department web site \cite{pccmathdept}. + +\subsection{Piloting of DE courses geared to a specific subset of CTE students} +In 2009, Choul Wou, a Perkins advisor, asked Michele Marden collaborate with her to create a reference document to support CTE students in the Building Inspection, Interior Design, Architecture, and Drafting programs. +There was a particular need to bridge from MTH 65 coursework to ARCH 122. +Michele observed an ARCH 122 section and a document was created. +Soon after, Michele was approved to teach two sections of MTH 60 and one section of MTH 65 reserved for CTE students in the programs stated above. +The course focus was limited by the requirements of the CCOGs, but whenever possible, material was geared to support the mathematical needs for these programs. +This experience led to the awareness that the reference document needed significant revision; however, due to the development of CTE-focused courses, the reference document was not updated. +The specialized courses were discontinued due to lack of enrollment. + diff --git a/test-cases/oneSentencePerLine/pcc-program-review4.tex b/test-cases/oneSentencePerLine/pcc-program-review4.tex new file mode 100644 index 00000000..288af48f --- /dev/null +++ b/test-cases/oneSentencePerLine/pcc-program-review4.tex @@ -0,0 +1,1023 @@ +% arara: pdflatex: {files: [MathSACpr2014]} +% !arara: indent: {overwrite: yes} +\chapter{Other Curricular Issues}\label{chap:otherissues} +\epigraph{Education is the only business still debating the usefulness of + technology.}{Rod Paige, former U.S. Secretary of Education (2002)} +\section[Distance education]{To what degree are courses offered in a Distance + modality (online, hybrid, interactive television, etc.)? For courses offered + both via DL and on-campus, are there differences in student success? (Contact + the Office of Institutional Effectiveness, either Laura Massey or Rob Vergun, + for course-level data). If so, how are you, or will you address these + differences? What significant revelations, concerns or questions arise in the + area of DL delivery?}\label{other:sec:distancelearning} + +The Math SAC offers Distance Learning (DL) courses in online, hybrid, and +interactive television (ITV) modalities. We strive to make our DL course +experience simulate the face-to-face course experience with respect to +instructor presence, feedback, and assessment. We use discussion boards to +simulate the classroom learning environment, and an array of online homework +platforms to assess and prepare our students effectively. A Math SAC DL standing +committee is charged with discussing the structure of our current DL courses, as +well as developing and maintaining current DL best practices and standards. + +\subsection{Presence of DL offerings} +All of our pre-college level math courses (except a calculator skills course) +have a DL offering, as do most of our lower-division collegiate courses. +Courses that are not offered using a distance modality fall into two categories: +those on the high end of our collegiate courses, and specialty courses with low +enrollments; \cref{tab:sec3:DLofferings} shows complete details. + +\begin{table} + \caption{Course Offerings through Distance Learning}\label{tab:sec3:DLofferings} + \centering + \begin{tabular}{ccccccccc} + \toprule + \multicolumn{3}{p{1in}}{Offered as DL} & \multicolumn{3}{p{1in}}{Not offered DL upper division} & \multicolumn{3}{p{1in}}{Not offered DL specialty}\\ + \midrule + 020 & 030 & 060 & 251 & 252 & 253 & 015 & 25C & 26C \\ + 065 & 070 & 084 & 254 & 256 & 261 & 061 & 062 & 063 \\ + 095 & 111 & 112 & & & & 093 & 105 & 211 \\ + 241& 243& 244& &&& 212& 213\\ + \bottomrule + \end{tabular} +\end{table} + +Approximately 14.1\% of PCC math enrollments were DL based during the +academic year 2012/13 compared to only 9.1\% in the 2007/08 academic year. +This percentage increase is coupled with a general enrollment surge over the +past five years, and the number of DL enrollments has grown by over 150\% in +this time period. \Cref{fig:sec3:DLenrollments,fig:sec3:F2Fenrollments} show +student enrollment in face-to-face courses compared to online courses over six +academic years. Note that even while overall enrollment has declined some since +its peak in 2011/12, that absolute enrollment in DL courses has still grown. +\Cref{tab:sec3:F2FandDLdata2007,tab:sec3:F2FandDLdata2010} give more detailed +data---note that we do not offer classes above MTH 244 in a DL modality. + +\begin{figure}[!htb] + \begin{minipage}[t]{.5\textwidth} + %\includegraphics[width=\textwidth]{graphics/enrollmentInDL.pdf} + \input{graphics/enrollmentInDL.tex} + \caption{Enrollments in DL}\label{fig:sec3:DLenrollments} + \end{minipage}% + \begin{minipage}[t]{.5\textwidth} + %\includegraphics[width=\textwidth]{graphics/enrollmentInF2F.pdf} + \input{graphics/enrollmentInF2F.tex} + \caption{Enrollments in face-to-face classes}\label{fig:sec3:F2Fenrollments} + \end{minipage} +\end{figure} + +\begin{table}[!htb] + \begin{widepage} + \centering + \caption{DL \& Face-to-face (F2F) enrollments and pass rates 2007--2010} + \label{tab:sec3:F2FandDLdata2007} + \input{tables/dlvsF2FenrollPass2007-2010.tex} + \vspace{2pc} + \caption{DL \& Face-to-face (F2F) enrollments and pass rates 2010--2013} + \label{tab:sec3:F2FandDLdata2010} + \input{tables/dlvsF2FenrollPass2010-2013.tex} + \end{widepage} +\end{table} + +As enrollment demand for DL math courses has increased, we have increased the +number of sections that we offer and trained more interested faculty in managing +DL courses. Between the academic years of 2003/04 and 2007/08, the annual +number of sections offered increased from 51 to 87. In the 2012/13 academic +year, we offered 185 DL sections. The resulting increase in sections offers +access to students that can succeed in this modality and need this option due to +outside constraints such as work and family. + +\subsection{Success rates in DL courses} +Pass rates in DL courses are quite noticeably lower than those for their +face-to-face counterparts; \cref{fig:sec3:F2FandDLpassRates} visualizes the +difference in pass rates between the highest enrollment DL courses that we offer +and their face-to-face counterparts. More detailed data for all DL offerings can +be seen in \cref{tab:sec3:F2FandDLdata2007,tab:sec3:F2FandDLdata2010}---see also +\vref{app:sec:dlsuccess}. We recognize that students need a +certain level of self-discipline, better study skills, and comfort engaging with +technology to succeed in a DL course. However we currently have no method for +screening which students are less likely to succeed using a distance modality; +our recommendations on \cpageref{other:sec:recommendations} attempt to address this issue. + +Referencing \cref{fig:sec3:F2FandDLpassRates}, +it is clear that, in the six academic years shown, the pass rates +generally decrease regardless of delivery mode. We hypothesize that this +overall trend is mostly the result of the economic collapse of 2008 which led to +increased enrollment and changes in our student demographics (see demographics +data in \vref{app:sec:demographicdata}). But the pass rates in DL courses are +as much as 30\% lower than in face-to-face counterparts and this large +discrepancy needs to be addressed. + +\begin{figure}[!htb] + \begin{widepage} + \begin{subfigure}{.3\textwidth} + \input{graphics/passRatesByModality020.tex} + \captionof{figure}{MTH 20} + \end{subfigure}% + \begin{subfigure}{.3\textwidth} + \input{graphics/passRatesByModality060.tex} + \captionof{figure}{MTH 60} + \end{subfigure}% + \begin{subfigure}{.3\textwidth} + \input{graphics/passRatesByModality065.tex} + \captionof{figure}{MTH 65} + \end{subfigure} + + \vspace{2pc} + + \begin{subfigure}{.3\textwidth} + \input{graphics/passRatesByModality095.tex} + \captionof{figure}{MTH 95} + \end{subfigure}% + \begin{subfigure}{.3\textwidth} + \input{graphics/passRatesByModality111.tex} + \captionof{figure}{MTH 111} + \end{subfigure}% + \begin{subfigure}{.3\textwidth} + \input{graphics/passRatesByModality243.tex} + \captionof{figure}{MTH 243} + \end{subfigure} + \caption{Pass Rates By Modality} + \label{fig:sec3:F2FandDLpassRates} + \end{widepage} +\end{figure} + +The difference in student-success rates between on-campus courses and DL courses +is an important issue for the Math SAC. The Distance Learning Standing +Committee has met to consider this issue and the factors that lead to this +difference in success rates. We can only speculate the reason for the disparity +based on anecdotal evidence and professional experience. Students may no longer +see DL courses as unusual, so they may be unaware that successful DL math +students should have stronger study skills, self-discipline, and time management +skills than face-to-face math students absolutely need to be successful. We +believe that many students register for DL math courses without adequate +understanding of the study habits, time commitment, learning styles, and +technical skills that are necessary for success in these classes. Anecdotal +evidence suggests that some students who are aware of these issues and who would +otherwise enroll in a face-to-face section still enroll in a DL section due to a +lack of space in face-to-face sections. + +There is currently a DL orientation available for DL students, but there is no +requirement that students complete it. Furthermore, there is no information in +the orientation to help students understand the particular challenges of +studying \emph{mathematics} using the DL delivery methods. In many disciplines, +reading, writing, and discussion can be sufficient for learning. Students in +mathematics typically do not learn best until they have also acted, by working +through exercises or active problem solving. In face-to-face classes, +instructors can monitor that this learning-through-action is happening more +easily. In DL courses, there is more of a need for students to rely on +self-discipline to complete this portion of their learning, and this is not +communicated in the existing DL orientation. + +\subsection{Informing DL students} +The Course Information Page (CIP) is accessible to students registering for DL +courses and is meant to give section-specific information to students as they +decide which sections to register for. Many faculty members use this system to +inform students of issues related to an online mathematics course. For example, +faculty address the misconception that a DL class requires fewer hours of +attention per week than a face-to-face class. We believe that many students do +not visit the CIP for DL classes and continue to be unaware of the tools they +will need to be successful in a DL mathematics course. Some faculty members +send emails to registered students before the term starts, asking them to read +the CIP; it is not clear, however, how many students read this email or act on +it. The link to a CIP is only available via the online class, and not via +MyPCC; this lack of presence may contribute to the issue. + +Other methods that are employed by DL faculty to directly communicate with their +students include: +\begin{itemize} + \item using the Course Progress Notifications (CPNs); + \item placing telephone calls to students; + \item using Collaborate to hold online office hours in a kind of visual and aural chat session. +\end{itemize} + +\subsection{Online homework platforms} +Faculty have sought to increase engagement by DL students through use of online +homework platforms. An online homework platform can provide students with +immediate feedback and also hold the student accountable for completion of +assigned exercises. Faculty can monitor progress and employ formative assessment +from a distance. + +The SAC recognizes that program changes should come from research toward best +practices. Faculty members Wendy Fresh, Rebecca Ross, Tammy Louie, Jessica +Bernards, and Diane Edwards have investigated the effects of use of an online +homework system in several experiments in both DL and face-to-face courses. In most +cases, results from these experiments suggest there may be positive effects to +using an online platform, but it remains too early to declare statistical +significance. To demonstrate statistical significance in studies of this nature +requires considerably large sample sizes. + +However Jessica Bernards has been able to measure one positive effect to a +significant degree. Instructor Bernards taught several online sections of MTH +111, with control groups doing homework from the textbook and submitting paper +write-ups, and experimental groups using online homework. The withdrawal rate +was 32\% for the control group and only 16\% for the experimental group, and +this difference was statistically significant ($P<1\%$). Instructor Wendy Fresh +ran a very similar experiment with online sections of MTH 60. There may still be +an effect at that level, but more data is necessary to confirm with statistical +significance. Both instructors noted modest improvement in exam scores among the +experimental group, but again more data is being gathered to confirm with +significance. + +For more information on research by Instructors Bernards and Fresh for DL +courses, see \vref{app:sec:onlinehwstudy}. For information on research by +instructors Edwards and Louie, see \vref{app:sec:aleks} and also +\cpageref{sec3:subset:alekspilot}. Research on the efficacy of WeBWorK (an online +homework platform discussed on \cpageref{other:sec:webwork}) was done in +\cite{focuswebwork}. In \cite{brewer} it was found that when students are +segregated by incoming ability, those who were less prepared when entering a +course do benefit significantly from online homework use. As a community +college, we have more under prepared students than universities, so this +finding suggests that use of online homework may be more helpful at PCC. It is +important to note that each of these studies were done with face-to-face +courses; in DL courses the traditional homework alternative presents the +challenge of delivery, complicating the question in favor of using online +homework. + +\subsection{WeBWorK}\label{other:sec:webwork} +Recent exciting developments at PCC have centered around the free and +open-source online homework platform called WeBWorK that is partially funded by +the National Science Foundation and maintained by the Mathematical Association +of America. By Spring 2014 we expect that over 20 faculty will be using WeBWorK +in their courses. The Math SAC is also loaning out the services of Alex Jordan +to CTE and LDC science SACs to create free online homework review programs. We +envision using WeBWorK for future Learning Assessment research and placement +advising. We are working with Dual Credit instructors to offer WeBWorK services +to Portland Public Schools. + +Most of the textbooks currently in use by the Math SAC are published by Pearson +Publishing, which offers MyMathLab for its online homework platform. While +MyMathLab and similar commercial products come as a bundled expense with new +textbook purchases, a separate online account for pairing with a used textbook +purchase is rather expensive. For this reason, face-to-face instructors rarely +require MyMathLab in their courses. On the other hand, Distance Learning +instructors have a stronger need for an online homework platform and the +majority of DL instructors do require that students use (and pay for) MyMathLab. + +By contrast, WeBWorK is a platform for online homework that is free and +open-source. As there is no central headquarters for WeBWorK, it must be +installed on a server somewhere. Since joining the Math SAC in Spring 2009, +Alex Jordan has championed the implementation and use of WeBWorK at PCC. Some +PCC math faculty have used WeBWorK in various capacities by borrowing server +space from the University of Oregon, a relationship formed and maintained by +Jordan. This partnership between two Oregon state institutions has been +mutually beneficial. While PCC gained server access, PCC faculty members were +programming content that the University of Oregon has been able to take advantage of. Each term since +Fall 2011, roughly 10 sections of PCC math courses have used the UO server. + +Over this period, WeBWorK users in the Math SAC lobbied Technology Solution +Services to provide the Math SAC with its own WeBWorK server. While the UO +server provided service to us, it came with certain restrictions and +complications that prevented WeBWorK at PCC from reaching its full potential. +For a time there was a chicken-and-egg situation, as TSS requested a greater +usage by PCC faculty before arranging for a server while some faculty chose not +to use WeBWorK because of the inconvenience of using the UO server. + +In the 2012/13 academic year, faculty Chris Hughes and Scot Leavitt researched +accessibility issues (in the ADA sense) alongside Disability Services. See +\cite{accessibilityproject} for the full report. Among many other findings, they +found that MyMathLab (at the time of the project) had many significant +accessibility problems while WeBWorK was quite close to being fully ADA +compliant. The open-source nature of WeBWorK meant that the few remaining +obstacles to accessibility could be addressed. They recommended that the SAC +cease using MyMathLab for newly developed courses and newly developed online +shells. They also recommended that faculty migrate from MyMathLab to WeBWorK. +Disability Services supported their recommendations, and also began lobbying TSS +for a PCC WeBWorK server. Within the WeBWorK community PCC is now seen as a +leader when it comes to accessibility issues. See \cite{webworkblog} for a post +about this on the WeBWorK news blog. As a result of this, PCC is hosting a +WeBWorK development camp in August 2014 with a central theme of addressing +accessibility issues and enhancing its accessibility.\label{other:page:disabilityservices} + +TSS partnered with the Clackamas Education Service District to deliver a WeBWorK +server that has been fully implemented since Winter 2014. SAC members Alex Jordan, +Chris Hughes, and Xiaolong Yao have prepared +\href{http://webwork.pcc.edu}{webwork.pcc.edu} for regular use starting Winter +2014 term. A backup server at +\href{http://webwork-dev.pcc.edu}{webwork-dev.pcc.edu} is in place for faculty +to experiment with. + +The arrival of our own WeBWorK installation has significant implications beyond +homework management, particularly in the advising department. We envisage that +advisors would enroll students in a `review course' that contains (mostly) +pre-college practice problems, and that the student would be encouraged to sit +the COMPASS placement test only when they are comfortable with the problems in +WeBWorK. Furthermore, we can easily use WeBWorK as an advising tool to replace +Hughes' Placement Advisory Test (\cite{mathprogramreview2003}, pages 12--13) in +situations when students are not happy with +their placement from COMPASS. The SAC should work with advising to implement +this. + +\subsection{PCC WeBWorK problem library} +WeBWorK has been in use at universities for some time now, and an extensive +library exists of math problems for college level courses. However there was +weak content support for basic algebra and other pre-college topics. Over +Summer 2013, Alex Jordan, Chris Hughes, and Xiaolong Yao oversaw an effort to +create +a library of high-quality, algorithmically generated, basic algebra WeBWorK +exercises which was partly funded with an IIP development grant; they received +support from math instructors Kandace Kling, Debbie Neft, Jeremy Shaw, and Danielle Rice. These +exercises currently cover topics from MTH 60 and 65, and the team continues to +add problems to the library for MTH 95. The library development was a success +because of the strong collaboration and dedication of the three faculty members, +and the foundations that Jordan had laid in previous years. Jordan, Hughes, +and Yao presented their work at the STEM showcase (Rock Creek) in Fall 2013 (see +\cref{webworkposter}). It was at this showcase that the idea was hatched to +create free online homework review programs for CTE and LDC science SACs. + +\begin{figure}[!htb] + \centering + \includegraphics[width=0.5\textwidth]{webworkposter} + \caption{WeBWorK poster from the PCC STEM Showcase}\label{webworkposter} +\end{figure} + +As time and funding progress, SAC members with the requisite coding experience +hope to add more problems to this PCC library, expanding into the arenas of MTH +courses 20, 111, 112, 243, and 244. It is important to note the level of quality +of the problems from this library. Each problem has a full walk-through solution +coded along side the question which can be put to use by faculty in a number of +ways. Each problem is given fine attention to detail so that automated feedback +messages to the students are as informative as modern technology can allow. This +high level of quality requires time and experience to achieve. However it is +necessary if any instructor hopes to use WeBWorK as a teaching tool and not just +an assessment tool. + +\subsection{Concerns about DL offerings} +Each of the following three issues have been raised by SAC members, and during +the 2012/13 academic year a group of concerned faculty met to discuss them. The +meetings were informal and no binding decisions were reached. +\begin{itemize} + \item Faculty are concerned about whether or not Distance Learning is an + effective way to deliver math content, especially in light of the low pass + rate statistics seen in \cref{fig:sec3:F2FandDLpassRates}. Successfully + learning mathematics generally requires heavy active engagement. Face-to-face + courses facilitate this engagement by requiring students to be in the physical + presence of their instructor and fellow students. In DL courses, the + imperative to remain engaged must come mostly from the student's own sense of + responsibility and interest. + \item Faculty are concerned about the quality and consistency of current DL + courses. Some faculty rely on publisher content such as electronic versions of + textbooks, while other faculty have created complete sets of online notes + themselves and use e-books only as secondary resources. Instructor Chris + Hughes serves as an advisor to online faculty creating new courses, and makes + recommendations to improve course quality and observe accessibility standards. + However there is no enforcement of the online advisor's recommendations. + \item Faculty are concerned about the portion of a student's grade that may be + computed from online homework. Compared to traditional homework, online + homework is more readily vulnerable to cheating. With many math exercises, the + exercise can literally be typed in to Google and the search engine itself + provides an answer. Online homework provides fewer obstacles for a dishonest + student to employ someone else to do their homework for them. In fact, in + Craigslist sites nationwide, all one need do is search for `mymathlab' to find + advertisements from those who will `take your online math course for you' at a + cost. The Math SAC has always wanted its online courses to mirror its + face-to-face courses, and as a consequence has never created CCOGs that treat + face-to-face and online courses differently. This has made it difficult to + place any cap on the portion of a grade that may be computed from online + homework. There is also no consensus on what an appropriate cap would be. +\end{itemize} + +\subsection{Recommendations}\label{other:sec:recommendations} +Our main recommendations concern how to best inform students about the +particular skills that a distance learning student should have or adopt in order +to be successful. We also recommend enacting some prerequisite items for DL +registration to help give these skills to students. Lastly there are some +recommendations that do not fit these descriptions. Many of these +recommendations hold for face-to-face courses as well, and may be repeated elsewhere in +this program review. +\begin{description} + \item For the Math SAC: + \begin{itemize}[label={}] + \item \recommendation[Math SAC]{Consider how the quality of online courses + could be improved by more effective regulation by the SAC. } + \end{itemize} + \item For Administration/Advising: + \begin{itemize}[label={}] + \item \recommendation[Math SAC, Distance Learning, Advising]{Advising and the Math SAC should collaborate to implement a WeBWorK-based review + mechanism for would-be placement test takers.} + \item \recommendation[Math SAC, Distance Learning, Advising]{Give students more information on + DL responsibilities and make students + aware of the difference in student-success statistics between DL and face-to-face courses.} + \item \recommendation[Math SAC, Distance Learning, Advising]{Encourage students to contemplate + why they seek to take a DL course and + reflect upon whether it will align well with their learning style and + personal skill sets.} + \end{itemize} + \item For Administration/DL/TSS: + \begin{itemize}[label={}] + \item \recommendation[Distance Learning, TSS]{Have the online orientation linked from the registration tool in MyPCC and + require that students complete this orientation before registering for a DL + class.} + \item \recommendation[Math SAC, Distance Learning, Advising]{Include a section in the DL orientation that addresses the specific + challenges that DL brings to mathematics courses. Perhaps only students + seeking to register for a mathematics DL course would be required to complete + this section.} + \item \recommendation[TSS]{Add redundant access to the Course Information Page. Along with access + through the online Class Schedule, the CIP could be available through MyPCC on + the home page for a course and through Desire To Learn.} + \item \recommendation[Math SAC, TSS]{Include a pop-up or hover-over window that is activated when a student + tries to register for a DL MTH class that gives specific information about the + challenges of DL Math courses. } + \end{itemize} + \item For Administration/Other: + \begin{itemize}[label={}] + \item \recommendation[Math SAC, Curriculum Committee]{Require students to demonstrate pre-requisite computer literacy skills + such as those taught in basic internet skills (CAS 104), beginning Word (CAS + 216), beginning keyboard (CAS 121), and basic computer skills/MS Office (CAS + 133).} + \item \recommendation[CAS SAC]{Develop and require a basic DL/computer skills competency course, possibly + offered during week 0 of the term. } + \item \recommendation[Math SAC, Division Deans, Deans of Instruction]{Provide opportunities for faculty professional development in research + design and data analysis to help with research efforts on the efficacy of + online homework.} + \item \recommendation[Math SAC, Division Deans, Deans of Instruction, Advising, Completion Investment Council]{Provide + support for further development of WeBWorK related projects, + including a larger library of math problems for courses beyond 60/65/95, + enhancements of the WeBWorK engine, and content for placement advising/review.} + \end{itemize} +\end{description} + +\section[Curricular changes resulting from educational initiatives]{Has the SAC + made any curricular changes as a result of exploring/adopting educational + initiatives (e.g., Service Learning, Internationalization of the Curriculum, + Inquiry-Based Learning, Honors, etc.)? If so, please describe.}\label{cur:sec:curchange} + +The Math SAC has made numerous substantial changes to its curriculum. Those +that are based in exploring or adopting educational initiatives are listed here. More +changes to the math curriculum are discussed in \vref{cur:sec:other}. + +\subsection{MTH 111H College Algebra: Honors}\label{cur:sub:111H} + +The course has been offered only at Sylvania campus---Winter 2012 (12 +students), Winter 2013 (22 students), Spring 2013 (15 students), and Fall 2013 +(17 students). Ronda Lively was the instructor the first three terms, which +allowed her to evolve her materials and activities. Ann Cary taught the +Fall 2013 term, and has collaborated closely with Ronda Lively. + +The honors course must cover the same material as the regular course. It +is stressed that honors versions of a course should not be ``harder'', but +different in the use of class time and activities/assignments. There should +also be a component of Community and Environmental Responsibility, which is a +PCC Core Outcome that is usually difficult to place in math courses. Instructor +Lively regularly teaches MTH 111 and MTH 111H during the same term. The same +exams were given in both courses. There were differences in the other evaluation +criteria used in the courses. In the MTH 111 class, students submitted take +home graded worksheets and participated in an in-class graded group activity. +The evaluation of the students in the MTH 111H class included: +\begin{itemize} + \item a collaborative computer project involving math history and investigation + of several applications of math; + \item a team quiz-grading activity where each group wrote a key and grading + rubric, then applied it to two (fictional) students' quizzes; + \item a community tutoring project: over several weeks, each student found someone to + tutor in math (friend, neighbor, family member, \ldots) and then wrote a paper + on their experience. +\end{itemize} +Since the overall student ability level was high, there was time in class to +investigate other topics of interest related to college algebra. Each term +there were several students that enrolled because of the time slot, +not because they were strong in math. Encouragingly, the +stronger students took the less prepared students under their wings and helped +them to be successful. + +\subsection{Social justice workgroup}\label{cur:sub:socialJustic} +A Math and Social Justice workgroup was formed by Ann Cary and Emiliano Vega in +response to a national convention they attended. The group has collected and +disseminated data sets and activities to participating math instructors and has +gained interest and participants from other disciplines at PCC, as well as area +high school math instructors and community activists in Portland. More +importantly, the group has the focus of providing a forum on how to discuss +potentially sensitive subjects in a classroom setting when using application +problems and how to be more culturally and socially aware of individual students +and classes. The information they gathered has improved the pool of activities and application problems +available, improved the ability of instructors to work effectively with the +broad demographic of students and co-workers, and also continues the college's +focus on two Core Outcomes: Community and Environmental Responsibility and +Cultural Awareness. For a sample of material from this workgroup, see +\vref{app:sec:socialJustic}. + +\subsection{Service learning}\label{other:sec:servicelearning} +Service Learning has been a part of many math instructors' courses at PCC, but +has been deepened through the Service Learning website +which includes additional resources and syllabi submitted +by participating instructors at PCC. In addition, Service Learning will be +added to some CCOGs evaluation criteria to encourage instructors to incorporate +Service Learning in their math classes. Jeff Pettit participated as +an observer in the Service Learning training cohort at Sylvania campus, +connecting with instructors in other disciplines and gaining an understanding of +how Service Learning is employed in other courses. This has led to new curriculum in his +Statistics courses and upper-division courses where Service Learning was not +originally employed. + +\subsection{Developmental Education math study group} +A new committee was formed by the SAC to address developmental math completion +rates. The committee is researching the feasibility, cost and difficulty +associated with implementing ``pathways'' beyond the current calculus focused +MTH 60--95 courses. The committee is considering options for employing +career-based math course series and a statistics-based math course series. + +\subsection{Placement test reform group}\label{other:sec:placementreform} +A committee has been formed to address placement test reform. The +group intends to better measure students' needs beyond the current math-skills +COMPASS test. We hope to find a way to measure key traits and needs of students +to connect student populations with the support needed to better guarantee +success. +% I had encouraged these guys to work with student services, who are also +% addressing these concerns. I don't know if they are or not though. I do +% know that student services is working with the NSF Grant proposal team on +% these issues. Perhaps a little more should be said here? + +\section[Present dual credit relationships]{Are there any courses in the program + that are offered as Dual Credit at area High Schools? If so, describe how + the SAC develops and maintains relationships with the HS faculty in support of + quality instruction. Please note any best practices you have found, or ideas +about how to strengthen this interaction. } + +During the 2012/13 academic year, PCC dual credit was awarded +for seven mathematics courses. Classes were offered at seven high schools and +there were a total of twelve instructors certified to teach PCC dual credit +mathematics classes. There were a total of 750 unduplicated students who +enrolled in at least one PCC dual credit mathematics class and collectively +those students earned 6032 mathematics credits through PCC. +In Fall 2012, an ad hoc committee was formed in the mathematics SAC to +investigate the status of our dual credit program. The formation of this +committee was prompted, in part, by the discovery that several of the posted +dual credit syllabi described courses that bore little resemblance to the +course for which students were earning PCC credit. The committee decided that +the root cause of this disconnect was a lack of robust support on our part. +Three concrete actions were taken to address the disconnect: +\begin{itemize} + \item Each dual credit mathematics instructor was assigned a team of two support + faculty from the mathematics departments at PCC. Each pair of support faculty + visited their assigned instructor at that instructor's high school. These + meetings were rather informal; the intent being to establish a concrete + support team for each high school instructor. + \item A two-day mandatory summer workshop was organized by the committee in + conjunction with Beth Molenkamp, who at that time was the coordinator of + PCC's dual credit program. At the workshop each dual credit instructor was + tasked to complete a robust (and accurate) syllabus for each of their dual + credit classes. The PCC faculty helped with this task and all of the dual + credit instructors now have syllabi that truly reflect the nature of the + course for which the students are earning PCC credit. The remainder of the + workshop was spent sharing resources and pedagogical tactics used by various + PCC faculty in the courses for which dual credit is also offered. + \item A Google Drive site was created to share resources. Although the + inspiration for this site was to give our dual credit faculty easy access to + shared resources, the pooling of resources is obviously of great benefit for + PCC faculty as well. +\end{itemize} + +\section[Future dual credit relationships]{Does the SAC plan to develop any + additional Dual Credit agreements with area high schools? If so please + describe. If not, what does the SAC see as barriers to developing further dual +credit agreements. } +Students at Central Catholic High School will get their first opportunity to +earn PCC mathematics dual credit during the 2013/14 academic year. This +adoption was coordinated through the dual credit program; that is, the Math SAC +played no active role in the creation of this dual credit agreement. + +There is concern in the mathematics SAC that the state's 40-40-20 initiative, +and the accompanying bills aimed at encouraging high school students to earn +college credits, might lead to a dramatic increase in the number of high +schools offering dual credit for mathematics courses. The greatest challenge is +that there are not that many high school mathematics instructors who meet PCC's +qualifications to teach post-100 level mathematics courses. We are concerned +that the day might come where we are pressured to lower those standards or, of +even more concern, we are pressured to start awarding PCC dual credit for +developmental mathematics courses (MTH 95 or below). + +\subsubsection{Addendum} +As feared, we are now being asked to allow high school instructors who do not satisfy minimum +qualifications to teach transfer level courses. As currently proposed, a high +school instructor who does not meet minimum qualifications would be paired with +an ``instructor of record'' who does meet the qualifications. There is also a +possibility that after a time the high school instructor will be deemed to have +``demonstrated competency'' and will at that point be allowed to become the +instructor of record based upon that criterion. We are concerned by this +proposal on many levels. + +The first is fundamental: this proposal undermines our established ``minimum qualifications.'' +While we realize that the pressure to make these changes originates from the State of Oregon and other outside parties, we +need to be mindful that our accreditation is also at stake. + +Additionally, there are fears that the concept will seep into the manner in which we staff classes +on our own campuses; an alternative minimum qualification such as ``demonstrated competency'' +cannot be exclusive to teachers in the high school classrooms. + +Finally, if the concept takes off at the dual credit level, there are serious workload concerns +for the faculty at PCC. The title of ``instructor of record'' comes with a serious amount of +responsibility and accountability; authentic and ongoing involvement in these courses will +require time from a faculty that is already stretched for time. We are presently being asked +to revamp our entire DE curriculum (and are actively involved in that pursuit), and adding +increased dual credit involvement to our list of duties will take away time from that agenda. +Priorities need to be established. If the college chooses to pursue this change in dual credit +policy we hope that the changes are instituted in a manageable and reputable way. + +\section[Other significant curricular changes]{Identify and explain any other + significant curricular changes that have been made since the last + review.}\label{cur:sec:other} + +The industrious Math SAC has made numerous changes to its curriculum that stemmed from a variety +of sources other than broad educational initiatives. (Curricular changes +stemming from broad educational initiatives are discussed in +\vref{cur:sec:curchange}.) These changes often arose from the perceived needs +of our students, innovative ideas from our faculty, evolutions in technology, +administrative restructuring, +and good old-fashioned housekeeping. + +\subsection{MTH 20 moved to the Math SAC from the DE SAC} +The MTH 20 curriculum was moved into the Math SAC from the DE SAC in Fall 2012, +bringing all math curriculum under the same SAC. This move was meant to help +create consistency in the CCOGs across the spectrum of math courses, as well as +ensure that the MTH 20 curriculum is adequately preparing students for the next +math course. + +Sylvania Campus, which had a separate DE Math department altogether, +transitioned its DE Math instructors into the Math Department in Fall 2013. A +Math Integration Work Group was formed and charged with creating a seamless path +for this transition. With the DE Math instructors in the Math SAC and the +current college focus on success in pre-college math courses, the Math SAC's focus is +on producing high-yield instructional practices, student success, and completion +across the span of math courses offered by the college. + +\subsection{MTH 20 proposed credit change: 4- to 5-credit}\label{cur:sub:mth20} +MTH 20 (Basic Math) is a content-heavy course that covers topics such as +fractions, decimals, signed number operations, geometry, proportions, and +percents. It can be argued that the amount of material covered in MTH 20 is +greater than in any of our other mathematics courses. At times, instructors are +forced to either minimize required topics or occasionally cut them entirely due +to time constraints. Because of this, for years many MTH 20 instructors have +wanted to increase the number of credits for the course. + +In October 2012, the SAC received a memo from the DOIs related to class sizes in +which we were encouraged to consider converting MTH 20 from 4- to 5-credits; a +subcommittee was formed by the SAC to investigate the benefits and +consequences of increasing the number of credits. The committee +looked into the financial aid impact on students, the impact on +degree/certificate programs, and the impact on classroom availability. It also +rewrote the CCOG to include study skills and increase the emphasis on reading +graphs and geometry in the course. + +In April 2013, the Mathematics SAC approved the conversion of MTH 20 from a +4-credit course to a 5-credit course. The conversion was then approved by the +Curriculum Committee in November 2013. Unfortunately, the current DOIs denied +the recommendation in late November 2013; since the original recommendation came to +the Math SAC in 2012, the college leadership has changed at many levels, and +with these changes have come changes in perspectives and goals for the math +curriculum. +The Math SAC is currently engaged in reevaluating and reorganizing pre-college +level math at all levels; it is highly likely that the first course will +require 5 credits for optimal student success. + +\subsection{MTH 60/65/70/95 curriculum alignment} +The Math SAC recognized that students successfully completing MTH 65 often had +difficulty passing MTH 95. The same was true for students transitioning between +MTH 95 and MTH 111. + +It was thought that creating more continuity between the MTH 60/65 series and +MTH 95 would improve student success. To this end, during 2008/09, a committee +was created to redesign the 60/65/95 curriculum with an eye toward carefully +preparing students for the rigor of college level mathematics. While MTH 60, +MTH 65 and MTH 95 had been traditionally taught as algebraically focused +classes, the committee adjusted the curriculum to reflect the need for students +to be able to understand mathematical information via the `rule of four': +algebraically, graphically, numerically and verbally. This was done to prepare +students for the demands of college level math and to align with the best +practices of our field. Importance was also placed on the use of a graphing +calculator in MTH 95 to aid in this. These changes were also reflected in the +intermediary course in the MTH 60/65/95 series: MTH 70. + +As with all curricular changes, there continues to be a need for ensuring that +all of the instructors receive the necessary communication and support in +implementing these changes. This is especially true for the part-time +instructors who are teaching a large proportion of the MTH 60--95 courses. However, +with the nature of the part-time instructor's working conditions, this continues +to be a challenge. The Math SAC requests more support from the administration +to provide the necessary funding for part-time instructors to attend +course-specific meetings similar to the one held for MTH 95 instructors at the +Sylvania Campus prior to the Fall 2013 term. + +\subsection{Replaced MTH 111A/111B/111C with MTH 105 and MTH 111} +In 1997 the Math SAC split MTH 111 into three courses in order to target +different student populations: MTH 111A for liberal art students, MTH 111B for +business and other non-technical majors, and MTH 111C for Science and +Engineering. In our last Program Review, \cite{mathprogramreview2003}, +it was mentioned that we eliminated MTH 111A and resurrected MTH 105 (see +\cite{mathprogramreview2003} page 19). +Since then, MTH 111B and 111C have merged again into MTH 111. + +The CCOGs for MTH 111B and MTH 111C had grown +increasingly similar; since both were prerequisites for the same courses +(MTH 243 and MTH 112), they needed to cover the same content. MTH 111B had a +reputation for being an easier course and many instructors noticed that students +in MTH 112 who had taken MTH 111B instead of MTH 111C were less prepared. Since +the two courses no longer served different purposes, and were creating problems +with student preparation for subsequent courses, we decided to unify MTH 111B and MTH 111C into a single +college algebra course starting in Fall 2012: MTH 111. + +\subsection{MTH 243 credit change: 4- to 5-credit}\label{other:sec:mth243} +The Math SAC increased credits for MTH 243 (Statistics I) from 4-credits to +5-credits for several reasons, most of which were related to a need to increase +the contact hours from four hours to five hours. In order to address the needs +of future coursework in statistics as well as sufficient coverage of material +for transfer to many universities, it was essential to add more material to the +4-credit MTH 243 course. Increasing the credit hours allowed for the necessary +contact time to cover such material appropriately. + + +Five contact hours allows for more integration of technology into the classroom, +since these technology skills are best learned with hands-on guidance from +the instructor. Formerly, it +was often difficult to have meaningful technology-oriented statistical classroom +exercises due to the lack of contact time. + +The change to five contact hours also gives sufficient time to fully engage the +students with critical thinking exercises and quantitative and statistical +literacy discussions. + +\subsection[Creation of AMP/MTH008]{Creation of two accelerated review courses +(also referred to as the Accelerated Math Program, or AMP) MTH 07 and MTH 08} +\label{other:sec:amp} +\begin{description} + \item[MTH 07: Accelerated Basic Math Review] This course presents a review of + basic math skills and provides the opportunity for guided practice. Topics + include operations with whole numbers, fractions, decimals, proportions and + percents. + + \item[MTH 08: Accelerated Introductory Algebra Review] This course presents a + brief review of basic algebra skills and provides the opportunity for guided + practice. Topics include real number operations, manipulating linear + expressions, solving linear equations, and graphing linear equations in two + variables. +\end{description} + +These two courses were designed to meet the needs of the following two student +populations: +\begin{itemize} + \item students who have previously learned the material and are able to test + into the next level of math as a result of a brief review; + \item students who have difficulty with the materials and can work on a variety + of the regular course material in advance of taking the regular course. +\end{itemize} + +Both courses are offered for one week in-between terms and are 15 non-credit lab +hours. They are taught with a combination of mini lectures and computer +practice/instruction. At the completion of each course, students retake the +COMPASS placement test. Each term a significant number of students taking these +courses have placed into a MTH course above their previous COMPASS placement. + +Sections have been offered at Rock Creek, Southeast, and Cascade, +with most offerings at Cascade, where the courses were initially +conceived and implemented by math instructors Holli Adams and Michael +Marciniak. Data from the sections taught at +Cascade Campus since 2010 can be viewed in \vref{app:sec:ampdata}. + +\subsection{Clarified CCOG requirements and addenda} +It was found that there were numerous discrepancies among different sections of +the same course having different instructors regarding the material being +presented. In an effort to ensure that students completing different sections of +the same course had similar mathematical competencies, the SAC determined that +communicating the requirements for a course needed to be made more concise. +Also, since the curriculum had significantly changed, we wanted instructors who +had previously taught the course to know about these changes. The CCOG for each +course was intentionally written more clearly and now includes specific minimum +requirements for testing and grading. In addition, each CCOG now has an +addendum that clearly shows examples of what is expected in terms of content, +mathematical notation and presentation as well as well-defined assessment +strategies. This practice has now been adopted for most of our CCOGs. + +\subsection{Elimination of MTH 91 and MTH 92} +MTH 91 and MTH 92 were created to address the issue of the high failure rate in +MTH 95 by splitting up the content of MTH 95 into two terms. The course +sequence was discontinued after data showed that students taking MTH 91 and 92 +were not successful in the subsequent course, MTH 111; it was found that after +taking these slower paced classes, the students were not prepared for the speed +of the MTH 111 course. + +\subsection{Changes in MTH 251--254} +The calculus series has been more strongly split into Calculus I/II and Calculus +III/Vector Calculus I by requesting the publisher split the current text into two sections. +This change altered the need for Maple in MTH 251 and MTH 252. Maple is an +expensive graphing software package that students buy for one year but generally +use only for Vector Calculus I. Attaching Maple to the new second half of the book +solved the issue of students losing access to it if they took more than one year +to complete the Calculus series. + +\subsection{Math study skills material development}\label{cur:sub:studyskills} +Research has shown that students with strong study skills are more successful in +their academic pursuits than their counterparts; however, many +students entering developmental mathematics courses lack these skills. +In an effort to help students build a stronger awareness of how a successful +student studies, Math SAC member Jessica Bernards from the Rock Creek Campus +created a Math Study Skills program to be used in our developmental math +courses. This program consists of seven topics all relating to study skills +specific to mathematics: how learning math is different, resources available for +help at PCC, time management, listening and note-taking skills, how to do +homework, test taking strategies, and overcoming math and test anxiety. + +Each lesson has three parts: a short video to be watched by students +outside of class, a student worksheet to be completed in conjunction with the +video, and an in-class discussion led by the instructor. Additionally, each +topic has quotes from successful students which help strengthen the ideas in +each video. Many math instructors across all campuses piloted the program in +the Spring 2013 and are continuing to use it this Fall 2013. For Winter 2014, +fourteen DE math instructors have reported that they will be using it. The study +skills website can be found at \cite{studyskills}. + +\subsection{MTH 111/112 document project}\label{cur:sec:111/112doc} +In Winter 2010, Math SAC member Chris Hughes proposed that the SAC write its own +MTH 111/112 textbook. This idea arose from a general frustration with +commercially available textbooks for this sequence. Available books tend to +fall on one end or another of a spectrum ranging from template-based and lacking +in conceptual understanding to abstract and lacking in guidance for students. +We seek something with better balance. Such a +textbook could also be provided to students at a much lower cost than any commercial +product. + +Initially over 10 members of the Math SAC became involved, submitting ideas and +small sections of what might someday become a textbook. As time passed, four +SAC members (Chris Hughes, Alex Jordan, Ann Cary, and Steve Simonds) maintained +serious interest in the project. Piecing together earlier work from the larger +group, expanding on that work, and editing, these four produced a rough draft +chapter representing about 10\% of a final product. (Given that this draft would +need editing, we estimate that it represents 5\% of the work necessary for +completion.) + +At this point the four remaining editors put active work on hold until some level of +release time can be secured that would enable completion in a timely manner. A +completed textbook for the entire sequence could be drafted with three faculty +taking one-third release time for two consecutive terms. An additional such +term would provide for peripherals such as guided lecture notes, an online +homework library, and LiveScribe videos. The progress to date can be found at +\cite{mth111project}. +% Math 111 textbook, recommendations/request: I hope that this is among your +% recommendations in chapter 6? + +\subsection{Supplemental course packets} +Textbooks that the Math SAC selects for courses often have gaps when +compared to the CCOGs for that course. Supplemental course packets were created +to fill in the gaps and are required for those specific classes. These include +explanations of topics not covered in the textbook as well as example +problems to fully cover a topic that might be lacking in the textbook examples. +Supplemental course packets have been created for MTH 60, 65, 95, 111 and 112, +and can be (freely) downloaded from the Math department's web site +\cite{pccmathdept}. + +\subsection{MTH 251 lab manual} +Since the late 1990s, MTH 251 has been taught in a lecture/lab format. From +that time through the late 2000s the materials used during the lab portion of +the course were frequently modified. By 2009 the lab manual had +devolved into a collection of random problems and there was simply no connection +between one set of problems and the next; there also were limited central themes to any one set of problems. + +In Summer 2009 faculty member Steve Simonds rewrote the lab manual from +scratch. The problem sets were written in a deliberate way to help students +develop deep understanding of key concepts covered in the course. The majority +of the problems from the prior lab manual were then shuttled to the appendix as +practice problems for outside of class. All of the practice problems were fully +keyed so that the students could continue thinking about the ideas (and +practicing the skills) covered in lab and then determine for themselves if they +had come to reasonable conclusions. + +\subsection{MTH 105 course material flexibility} +Each math course has traditionally used the same SAC approved textbook +district-wide. The Math SAC broke from this tradition and voted to allow MTH +105 instructors to choose their own course material, provided it meets the +approval of the MTH 105 CCOG committee. Unlike other math classes, MTH 105 is not a +prerequisite for other math courses, and is a terminal math course for many +of our students. Each term, the instructor selects three to five topics from a +list of 17. This allows the instructors flexibility to teach material +appropriate for the student population of each class. + +\subsection{ALC math courses} +The ALC math courses are self-paced pre-college math courses\footnote{The Alternative +Learning Center (ALC) was an old name for the current Sylvania Student Learning Center.}. +They are designed for students to work independently at their own pace and allow +them to focus on specific topics. Consequently, a wide range of students take +these courses: students who are afraid to take a math class and want to get back +into math slowly; students who failed a math class once or several times; students +who feel that they placed too low on the placement test and just need a review; +students who want to get through the material quickly; and international +students who know the math but not the English terminology for it. At Sylvania, +the majority of students who take ALC Math are students who have failed math classes, +sometimes many times. + +Historically, the ALC math courses have been offered at Sylvania Campus, housed +by the Developmental Education SAC, and covered math content through MTH 65. +Since Summer 2012, they have also been offered at Southeast. Since +Winter 2013, ALC is housed in the Math SAC and, since Fall 2013, it also +includes MTH 95. For a more thorough look at these changes see +\vref{app:sec:alc}. Considerations are currently being made to find ways to have +ALC Math at Cascade and Rock Creek. Students from these campuses are +already using ALC Math at Sylvania and Southeast and are undergoing the hardship +of travel just so they can take these courses. + +Enrollments at Sylvania and Southeast both show that there is clearly a need for +these courses. Research done by PCC's Institutional Effectiveness on data from +five years at Sylvania shows that students who complete ALC Math successfully +pass their math classes at a higher rate than before taking ALC Math (see +\vref{app:sec:effectivenessALC}). + +\recommendation[Math SAC, Deans of Instruction, Deans of Students, Advising, Completion Investment Council]{We recommend using the ALC +math classes as an early intervention when students fail math classes.} + +At Sylvania, for instance, some full-time advisors have familiarized themselves with the ALC math courses and +suggest them to students early on. Others send students to the Math Coordinator for +further advising regarding successfully completing math classes. + +\subsection{MTH 84: Introduction to \LaTeX}\label{other:sec:mth84} +In Spring 2010, Math SAC members Alex Jordan and Chris Hughes proposed a pilot +course to teach the typesetting software \LaTeX. The experimental, one-credit course was piloted for +three consecutive terms (Fall 2010, Winter 2011, and Spring 2011) and then +adopted by the SAC as MTH 84. The course was first run (as MTH 84) in Winter +2012, and has run each term since with one section per term. MTH 84 is a one-credit +pass/no-pass course. Its modality has been DL, although the CCOG does not +prevent a face-to-face version. The course serves students and faculty alike in many areas. +\LaTeX\ is a useful tool in math, the sciences, in graphic design, and in +publishing; it can easily be used to typeset internal documents, such as \href{http://www.youtube.com/watch?v=XhduoHOYXUY}{\color{black}Program Reviews}. + +\subsection{MTH 76 Math SAC approval} +The SAC approved the CCOG for a one-credit `Introduction to GeoGebra' course. The course is +planned to run as a pilot course in Spring 2014 and Summer 2014, with tentative +approval to let it run as a permanent course Fall 2014. The audience for the +course includes PCC students, PCC instructors who wish to use it as a teaching +tool, and K--12 teachers who wish to use it as a teaching tool. The course was +requested by high school teachers participating in the Dual Credit workshop in Summer 2013. + +\subsection[ALEKS pilot]{Pilot using ALEKS technology in two math courses during AY 2012/13}\label{sec3:subset:alekspilot} +ALEKS technology requires students to complete each mathematics topic +successfully, keeps track of student work time, provides instant feedback, +routinely assesses students and requires them to revisit previously learned +material. It allows students to study a variety of topics at a time and +minimizes practice of mastered material. Two pilots of ALEKS in MTH 20 and MTH +112 were conducted. + +\begin{description} + \item[MTH 20: Basic Mathematics] ALEKS was incorporated into six online and six + on-campus MTH 20 classes. Data was compared to the previous year's MTH 20 + classes taught by the same two instructors, Diane Edwards and Marilyn + Marshall. On average, courses using ALEKS had noticeably higher pass rates + than non-ALEKS courses. For example, there was an 11\% increase in pass rates + in on-campus ALEKS classes in Fall 2012 compared to non-ALEKS Fall 2011 + classes. Both on-campus and DL classes showed increased passing rates using + ALEKS. In addition, a few students each term were able to complete two + courses during one term, finishing Basic Mathematics early and then + successfully completing MTH 60. + + \item[MTH 112: Elementary Functions] ALEKS was incorporated into one Elementary + Functions section and compared with two traditional sections, all taught by + faculty member Tammy Louie. In this small sample, both the grade distribution + and pass rates were similar. However the student retention rate in the ALEKS + class was 17.3\% higher than in the non-ALEKS classes. + +\end{description} + +In both pilots students were observed to enjoy using ALEKS and increase their +study time while using ALEKS. More detailed data can be found in the +\vref{app:sec:aleks} concerning both pilot projects. These pilots of ALEKS had +noticeable success with student perception and involvement. Further +exploration of ALEKS technology should be pursued as a possible option to +improving student success in mathematics courses. + +\subsection{MTH 112 formula sheet} +The SAC approved a standardized ``formula sheet'' for use in MTH 112. Math SAC +member Wendy Fresh revised and submitted a formula sheet edited from one +provided by SAC member Pete Haberman. The page was added to the course CCOGs to +help guide instructors and clarify evaluation expectations. + +\subsection{MTH 212 proficiency exam} +With SAC approval, the MTH 211--213 instructors added a basic skills proficiency +exam to MTH 212 that must be passed with no less than a 90\% in order to pass +the course. MTH 212 is the second of a three part series of courses for +students preparing to enter a teacher education field. The proficiency exam +covers basic operations on integers, fractions, decimals, and percents. +Although there is a MTH 95 prerequisite for the MTH 211--213 series, many of the +students do not remember these basic operations. Since these are topics covered +in MTH 212, it was felt that holding the students responsible for the basic +skills would help them grasp the concepts with more success. This approach has +been adopted by several of the Oregon community colleges and four-year +universities that offer the MTH 211--213 sequence. + +\subsection{Casio Classpad} +The SAC approved of the Casio Classpad as an additional recommended graphing +calculator in MTH 95 and Lower Division Transfer courses. In addition, the CCOG +for MTH 93, the one-credit graphing calculator class, was revised to reflect topics +specific to the Casio Classpad. Faculty members Tammy Louie and Alex Jordan +created a PCC-specific user guide for the Classpad, which is available for +download (along with earlier PCC calculator manuals) at the math department web +site \cite{pccmathdept}. + +\subsection{Piloting of DE courses geared to a specific subset of CTE students} +In 2009, Choul Wou, a Perkins advisor, asked Michele Marden collaborate with +her to create a reference document to support CTE students in the Building +Inspection, Interior Design, Architecture, and Drafting programs. There was a +particular need to bridge from MTH 65 coursework to ARCH 122. Michele observed +an ARCH 122 section and a document was created. Soon after, Michele was +approved to teach two sections of MTH 60 and one section of MTH 65 reserved for +CTE students in the programs stated above. The course focus was limited by the +requirements of the CCOGs, but whenever possible, material was geared to +support the mathematical needs for these programs. This experience led to the +awareness that the reference document needed significant revision; however, due +to the development of CTE-focused courses, the reference document was not +updated. The specialized courses were discontinued due to lack of enrollment. + diff --git a/test-cases/oneSentencePerLine/pcc-program-review5-mod1.tex b/test-cases/oneSentencePerLine/pcc-program-review5-mod1.tex new file mode 100644 index 00000000..0d32841f --- /dev/null +++ b/test-cases/oneSentencePerLine/pcc-program-review5-mod1.tex @@ -0,0 +1,481 @@ +% arara: pdflatex: {files: [MathSACpr2014]} +% !arara: indent: {overwrite: yes} +\chapter[Outcomes and Assessment]{Reflect on learning outcomes and assessment, + teaching methodologies, and content in order to improve the quality of teaching, + learning and student success.}\label{chap:outcomes} +\epigraph{Learning outcomes assessment is key to addressing both affordability and access issues} +{Knowing What Students Know and Can Do \cite{outcomesquote}} + +\section[Course-level outcomes]{Identify and give examples of assessment-driven + changes made to improve attainment of course-level student learning outcomes. + Where key sequences exist, also include information about assessment-driven changes to those sequences. + } + +The SAC has mostly concentrated on college level outcomes in the last five years for the following two reasons: \begin{enumerate} \item The Curriculum Committee currently requires an ``out there'' (\cite{courseoutcomes}) focus for course-level learning outcomes, with no requirement that outcomes be assessable or measurable. + \item The annual assessment reporting for the Learning Assessment Council (LAC) + has focused on the College's Core Outcomes, not course outcomes. +\end{enumerate} + +However, we are fortunate to have math faculty involved with the Learning Assessment Council (LAC) and the Curriculum Committee. +This involvement has kept our SAC aware of the college's ongoing discussions regarding a possible future change for the focus of course-level learning outcomes (i. +e., expectation of +measurability) and related accreditation standards (e.g., \cite[Standard + 4. + A. + 3]{NWCCU}). + +Many of our current learning outcomes were developed to satisfy the requirements of an ``out there'' focus and this has resulted in oddly worded or aspirational outcomes. +Here are two examples from MTH 251 (Calculus 1): + +\begin{quote} Appreciate derivatives and limit-related concepts that are encountered in the real world, [and] understand and be able to communicate the underlying mathematics involved to help another person gain insight into the situation. +\end{quote} +\begin{quote} + Enjoy a life enriched by exposure to Calculus. +\end{quote} + +While we hope that our students will be able to ``help another person gain insight into the situation'' and that they will ``enjoy a life enriched by exposure to Calculus,'' we recognize that outcomes like these are not easily measured. +Before our SAC can make assessment-driven changes to improve students' attainment of outcomes, we need to first develop measurable outcomes that represent the intent of our courses. + +In 2012/13 the MTH 60/65 CCOG subcommittee decided to develop course-level outcomes that were meaningful and assessable; this was done despite concerns that Curriculum Committee might reject them because they lacked the required ``out there'' focus. +The Math SAC was largely supportive of the shift to assessable outcomes, suggesting that we are supportive of the college transitioning toward a culture assessing outcomes at all levels. + +While crafting the new (\emph{draft}) course outcomes, the MTH 60/65 CCOG subcommittee connected each proposed outcome to an actual assessment activity used by a member of the committee in order to ensure that each outcome was truly measurable. +What follows are a few of the resultant (\emph{draft}) outcomes. +\begin{description} + \item[Argument Construction:] Construct and judge the validity of an argument. + (e.g., Why does a particular symbolic representation match a particular + graphical representation?) + + \item[Representational Fluency:] Demonstrate the ability to distinguish + different meanings of `variable', e.g., a variable can represent a varying + quantity in an expression or an unknown quantity in an equation. + + \item[Problem Solving:] Use appropriate (mathematical) tools in the context of + problem solving, modeling, interpreting, etc. (Know what approach to take, + what information you have, what information you need, what techniques you have + to solve the problem, what the graph tells you, what the formula tells you, + what model you can build). +\end{description} + +The current layout of the CCOGs does not differentiate critical content from less critical content. +To address this, the committee discussed the option of formatting the content area of the CCOGs in a pyramid structure with the most critical content highlighted at the bottom of the pyramid. + +The current CCOGs do not align the content to the course outcomes. +To help make the CCOG a better communication tool, the committee discussed making explicit connections between the course content and the course outcomes as well as explicit connections between the course outcomes and the college's core outcomes. +This work was in progress when we realized that this shift in outcomes should not be done in isolation from other courses in the pre-college math sequence; in response, we formed a DE Math Subcommittee with the goal of creating vertically aligned outcomes that created a coherent progression from MTH 20 through MTH 95. +Since its formation in June 2013 there has been a major shift in how we are hoping to approach DE level math courses. +As the Math SAC considers new math pathways for DE level students, the CCOGs for these new courses will likewise be explicitly aligned and measurable. + +In summary, we are interested in developing rich, meaningful, and measurable outcomes that better represent the intent of our courses than our current outcomes do. +Since course outcomes are required in syllabi, properly representing the intended focus for the course in the course outcomes is critical. +We hope that the conversations in the LAC and Curriculum Committee concerning course-level learning outcomes will lead to Curriculum accepting more flexible wording of course outcomes in the near future. + +\recommendation[Learning Assessment Council, Curriculum Committee]{The college should adopt a new model + for course-level learning outcomes that allow for outcomes that are more + descriptive of the actual content in the course and that are also better suited + for student-level and course-level assessment.} + +\section{Addressing College Core Outcomes} + +\subsection[Outcomes in courses and the math program]{Describe how each of the + College Core Outcomes are addressed in courses, and/or aligned with program + and/or course outcomes.} + +The college's Core Outcomes may be found at \cite{coreoutcomes}. + +\begin{description} + \item[Communication] is stated in many of our CCOGs as a course outcome. + We believe it is important for students to communicate ideas using mathematics in a meaningful manner through appropriate use of notation and concise, accurate statements. + Here are some excerpts from course outcomes in MTH CCOGs: \begin{aquote}{MTH 111--112, MTH 211--213, MTH 251--254} {\ldots}and then interpret and clearly communicate the results. + \end{aquote} + + \begin{aquote}{MTH 243--244} + {\ldots}and clearly interpret the results via written or oral communication. + \end{aquote} + + \begin{aquote}{MTH 111--112, MTH 243--244, MTH 251--254} + {\ldots}understand and be able to communicate the underlying mathematics + involved to help another person gain insight into the situation. + \end{aquote} + + \item[Community and Environmental Responsibility] is not directly addressed in + our courses or outcomes. + Our Social Justice Workgroup (see \cpageref{cur:sub:socialJustic} and \vref{app:sec:socialJustic}) discusses issues related to teaching with community and environmental responsibility in mind. + Also, sections of MTH 111H (see \cpageref{cur:sub:111H}) have a related component involving tutoring math to someone in a student's community. + Examples of Service Learning components used by some faculty are given on \cpageref{other:sec:servicelearning}. + + \item[Critical Thinking and Problem Solving] + is fundamental to mathematics so, at first glance, it may seem that there would + be easy agreement between mathematics faculty for how this Core Outcome is + present in our curriculum. + This is not the case. + + Some PCC math faculty believe that everything in a math course is a manifestation of this Core Outcome, including practice problems intended to develop procedural fluency in a non-contextual setting (e. + g., solve the quadratic + equation by the Zero Product Property). + Indeed, one can certainly witness the critical analysis required within the realm of procedural fluency when students struggle with mathematical abstraction. + This happens at the most basic level, especially for students who are not detail-oriented or unable to easily generalize abstractly in a non-contextual manner. + It is also present at higher levels of math when students are faced with skill-based problems that require integration of several previously learned procedures. + + Traditionally, the main focus of most undergraduate math programs is developing a students' algebraic procedural fluency (including our current curriculum). + While procedural fluency is important, some PCC math faculty wish to narrow the focus of this Core Outcome in a way that goes beyond procedural fluency. + Some examples include the development of students' ability to solve meaningful contextualized problems, explain concepts and justify results in a mathematically sound manner, analyze mathematical patterns, or create elegant proofs. + + Assessment work has made us aware of how differently we can view critical thinking and problem solving, and it has developed our thinking considerably. + This will remain an ongoing conversation. + At this time we have chosen to take the broad view of Critical Thinking and Problem Solving that includes procedural fluency. + + \item[Cultural Awareness] is not formally covered in any of our courses. + Some individual instructors may incorporate elements of cultural awareness into their classes. + Some examples of how cultural awareness could be addressed by individual math instructors instructors are: \begin{itemize} \item differences in notations and procedures used by different cultures; \item similarities and differences with regard to the use of mathematics as a tool; \item attitudes toward mathematics in various cultures (e. + g., math anxiety is% cultural awareness than teaching students the history of math.% purpose (of encouraging participation). Bottom line: there is more to% if anyone self-suppresses then the practice is ineffective to its very% banning hand-raising as a method of encouraging class participation, because% You may want to consider as a SAC creating a new paradigm in future classes% than the men in class. Apparently this is also true of minority students.% their hands in class, though they often know the answer as well as or better% need the original research) that women are less likely than men to raise% Chairsell gave me to read, though that book references other studies if you% I was reading recently (in the book ``Lean In'' which as it happens Chris + not a worldwide issue); + \item history of mathematical development in various cultures and how it was + influenced by dominant philosophical attitudes of the region; + \item use of mathematics as an agent of social change by shining a light on + inequity with regard to treatment of, and resource allocation for, + marginalized populations as compared to the dominant culture; the social + justice workgroup considers this---see \cpageref{cur:sub:socialJustic} and + \vref{app:sec:socialJustic}. + \end{itemize} + + \item[Professional Competence] is described by PCC as the ability to + ``demonstrate and apply the knowledge, skills and attitudes necessary to enter + and succeed in a defined profession or advanced academic program.'' As a + discipline that builds upon prior knowledge and skills, successful completion + of any of our sequenced courses prepares students for the next math course. + A certain level of mathematical competency is valued by PCC and is required for all of our degree-seeking students. + Currently, most students show math competency by taking a math course at PCC. + In this way, the Math SAC plays a critical role in the professional competence for students' educational goals whether it be for a defined profession or advanced academic program. + Discussions about the necessary mathematical knowledge, skills and attitudes for the wide range of educational goals of PCC's students are ongoing. + % Consider adding a whole new paragraph that maybe starts ``Additionally, we + % hope to offer new new DE level courses that will focus on STEM applications + % as an integral part of learning math. This would improve student ... + + Additionally, we offer one sequence that directly addresses professional competence within math education: Our MTH 211--213 ``Foundations of Elementary Mathematics'' sequence of courses are taken by students interested in pursuing a career in teaching in the K--12 education system. + At minimum, two of the three courses are prerequisites for obtaining a degree in Education in Oregon. + Each course emphasizes specific topics of mathematical theory that are the basic building blocks of mathematics instruction in the K--12 system. + Some instructors require students to maintain a portfolio, learn multiple assessment techniques, do field observations of teachers in the K--12 system, learn about the Common Core Standards and trends in education both state and nation-wide, and are given guidance in areas such as preparing for the CBEST and PRAXIS as well as decision making in the various avenues for pursuing a degree in education. + This exposure to what the field of education actually entails helps students make sound career choices early on in their academic pursuits. + \item[Self-Reflection] + is an outcome that we believe students develop in the course of their + educational experience. + Many Math SAC faculty believe we can assist this development; others question if this should be a responsibility of faculty (or if this should even be a Core Outcome of the college). + While the SAC needs more discussion to develop a shared understanding of what Self Reflection means in the context of a mathematics course and how to develop it, we believe that it is present in our curriculum. + + We are exploring aspects of Self Reflection; here are two examples: \begin{enumerate} \item Development of strong study skills will improving students' ability to self-reflect; consequently, the SAC has discussed adding study skills as formal components of MTH 20 (see \cpageref{cur:sub:mth20}). + See \cpageref{cur:sub:studyskills} for more information on study skills material that incorporates student self-reflection. + \item + In AY 2011/12 the Math Learning Assessment Subcommittee (Math LAS) explored + Self-Regulated Learning where students were guided in a self-reflective + process that helped them evaluate their depth of understanding (or lack + thereof). + Although Self-Regulated Learning was not incorporated into the assessment activity (due to the complexity and the lack of time remaining), members of the Math LAS who explored this believe it is worthy of future consideration. + \end{enumerate} +\end{description} + +\subsection[Core Outcomes Mapping Matrix]{Update the Core Outcomes Mapping Matrix for your SAC as + appropriate.\footnote{\url{http://www.pcc.edu/resources/academic/core-outcomes/mapping-index.html}}} +At this time, the Learning Assessment Council expects each LDC SAC to address and assess at least four of the college's Core Outcomes somewhere in their curriculum. +As shown in our current Core Outcomes Mapping Matrix (\vref{sec:app:coreoutcomes}), most of our courses address four Core Outcomes. + +To date, most of our outcome assessment activity has been focused in our lower-level courses. +Because of this, it is difficult for us to make truly informed distinctions about variations in outcome levels through our vast array of courses. +We offer many courses at the DE level as well as many courses at the 100 and 200 levels. +While it is obvious that the skills assessed at these various levels are quite different in scope, it is not as clear that the levels of Core Outcome achievement vary in a similar way. + +Consider level 4, which is described as ``Demonstrates thorough, effective and/or sophisticated application of knowledge and skills. +'' Does that phrase come with an implied ``appropriate +to the course level being assessed''? +The assignment of levels is very dependent upon the answer to this question. +There are other questions that can be asked that could also greatly impact the way in which levels are assigned. +To wit: \begin{itemize} \item Pitched vs. + \ Attained: Should levels be assigned based on ``the level to + which the course is taught'' or ``the expected level of attainment for a + student who passes with a C (or B or A)''? + + \item Coverage vs.\ Depth: If level 3 or 4 is assigned, should the Core Outcome + be a recurring theme in the course or can level 3 or 4 be reached if there is + only one or two assignments that have ``depth''? + + \item Prerequisite expectation: If a course has an expected prerequisite + knowledge/skill for a particular Core Outcome, which is critical for success + in the course, but not covered/developed in the course, what level should be + assigned: 1 or 4? + + \item Assessment: Is there an expectation for assessment for all courses based + on the assigned level (e.g., perhaps SAC-level assessment is required for + courses where a level 3 or 4 is assigned)? + + \item Benchmark comparison: If we rate a course with a 200 designation as + ``level 4'' for a particular outcome, is it appropriate to have a + developmental education course also at level 4 or should it be at most level + 2? + + \item Course-to-course comparison vs.\ stand-alone analysis: Generally, should + a course-to-course comparison even be done? + Perhaps given the various ways Core Outcomes might manifest, a course-to-course comparison is meaningless (i. + e., just as Critical Thinking and Problem Solving could be level 4 for + very different reasons across disciplines, it may be possible to have level 4 + for very different reasons within a single discipline). +\end{itemize} + +\recommendation[LAC, Degrees and Certificates Committee]{We recommend that the + LAC compose a concise but thorough document that precisely specifies the + context in which levels should be determined when a SAC constructs its Core + Outcomes Mapping Matrix.} + +\section[Assessment of College Core Outcomes]{For Lower Division Collegiate + (Transfer) and Developmental Education Disciplines: Assessment of College Core + Outcomes (note: Please include the full text of your annual reports as + appendices, and summarize them here).}\label{ass:sec:coreoutcomes} + +Our full annual Learning Assessment reports can be found at these links, and are summarized in the pages that follow. +\begin{description} + \item[2009/10:] \cite{annualLASreport2009} + \item[2010/11:] \cite{annualLASreport2010} + \item[2011/12:] \cite{annualLASreport2011} + \item[2012/13:] \cite{annualLASreport2012} +\end{description} + +\subsection[Core Outcome assessment design and process]{Describe the assessment design and processes that are used to + determine how well students are meeting the College Core Outcomes.} +We will discuss the evolution of the assessments by academic year, starting from 2009/10. +\begin{description} + \item [2009/10: Critical Thinking \& Problem Solving] + + This was the first year the LAC asked SACs to assess a Core Outcome. + Our assessment activity was developed by a small group of interested math faculty with minimal coordination with the full SAC. + Student artifacts were collected from the interested faculty who volunteered to give the assessment activity in their courses, and so it was not a statistically sound sample. + The activity involved both direct and indirect assessment: \begin{itemize} \item The direct assessment involved finding and correcting conceptual, arithmetic, and formatting mistakes in expected procedural skills for MTH 65 and MTH 95. + Students must know how to do the problem before they are able to to identify and correct mistakes. + This level of analysis is typically very difficult for students and is a high on Bloom's taxonomy. + \item The indirect assessment involved asking students to respond to questions + like, ``Do you feel this class has improved your critical thinking and problem + solving skills?'' + \end{itemize} + + \item[2010/11: Critical Thinking \& Problem Solving and Communication] + + At the beginning of Fall 2010, the Math SAC decided to create a standing committee to ensure assessment work was a high priority. + The Math Learning Assessment Subcommittee (Math LAS) was born. + There were 14 members, most of whom were full-time faculty. + This was a big improvement from last year's work where only a small group of faculty participated. + + Although our previous year's CT \& PS activity had been high on Bloom's Taxonomy, we decided that procedural skills did not fully capture how we want our student to think critically about mathematics. + Instead of continuing with the previous year's work, we decided to develop a new activity for CT \& PS. + + Still very new to assessment, we did not know what type of activity might generate the most useful information. + To help us decide, we developed three assessment activities and collected student artifacts for each activity. + The chosen activity was randomly given to 12 of the 72 sections of MTH 65 held in Winter 2011. + (Note: We also created an activity for MTH 244, but there was an + error in one of the questions. + Although a portion of the artifacts were evaluated, we ultimately decided to abandon this attempt and focus our limited resources toward the MTH 65 analysis. + ) + + For the MTH 65 assessment, we collected 240 student artifacts. + To help ensure that data would be a true SAC-level assessment (vs. + \ an evaluation of individual + instructors), faculty members were instructed to remove identifying information + from student work and submit their artifacts to an administrative assistant who + tracked submission of work only. + Sixteen members of the SAC were normed to the rubric that had been developed by the Math LAS. + Two members of the LAC's Program Assessment for Learning (PAL) facilitated this work and guided faculty through a trend analysis. + (Note: Our process and involvement of Math SAC + members was so impressive as compared to other large SACs that the Learning + Assessment Council awarded the Math SAC an ``Oscar'' at their Spring circus + event.) + + \item[2011/12: Self Reflection and Professional Competence] + + This year we sent a survey to all students enrolled in a math class in the first week of Spring 2012. + The Math LAS was awarded a LAC grant and we used these funds to hire a consultant, Una Chi, to help us refine the survey and evaluate the student responses to the survey. + We also discussed the wording of the questions with the DE Reading and Writing faculty members to help ensure the questions would be understood by all students. + Approximately 2300 students responded to the survey, and the response rates for particular courses mirrored student enrollment in those courses and other demographic information. + The survey was an indirect measure of students' perceptions. + + For Self Reflection, we focused on questions that we felt would fit the following three areas: \begin{enumerate} \item Reflection---Core reflective thinking items; autonomy and relatedness aspects from self-determination theory \item Orientation---Mastery/performance, internal/external locus of control (hold self responsible vs. + holding others responsible) + \item Competency---Belief about self-ability to perform in math + \end{enumerate} + Sample Self Reflection items on the survey: \begin{quote} I know when I need help on a math concept. + \end{quote} + \begin{quote} + When I get a math test back, my grade is what I expect it to be. + \end{quote} + \begin{quote} + My feelings about math affect my learning of math. + \end{quote} + + For Professional Competence, we used the suggestions of our LAC coach to craft questions about students' perceptions of math in terms of their future job and career goals. + + Sample Professional Competence items on the survey: \begin{quote} The skills I learn in a math class are not important to me or my future goals---I just need to pass the course. + \end{quote} + \begin{quote} + In PCC math classes, what knowledge, skills, habits or ways of thinking have you practiced that might help you in the work place? + [Choices included punctuality, + problem solving, working in groups, self discipline, career specific math + skills, interpret graphs/charts] + \end{quote} + \begin{quote} + My career interest requires some mathematical knowledge. + \end{quote} + + \item[2012/13: Critical Thinking \& Problem Solving and Professional Competence] + % On page 13 and 14 you discuss how individual course outcomes are not + % addressed due to the LAC focus on college core outcomes. But this year + % y'all totally addressed individual course outcomes, in the context of the + % CT & PS core outcome. Plus it was doubly recognized with awards. I think + % you should pull out this years' work as specifically covering course + % outcomes right upfront on page 13. + + This was our third investigation into Critical Thinking \& Problem Solving. + Our previous attempt had given us rich data, but this year we decided to investigate students' ability to solve nine math problems that specifically represent the topics covered in MTH 95 that we consider essential for success in MTH 111. + The assessment activity was administered to every face-to-face section of MTH 95 at all PCC campuses in the Winter of 2013. + We collected 677 student responses from 33 different sections across the college; all identifying information for both instructors and students were removed. + + The math problems included in the assessment were selected by faculty from our current MTH 95 textbook: \begin{itemize} \item For Critical Thinking \& Problem Solving: We incorporated problems that contain units and involve a real-world context. + \item For Professional Competence: We incorporated problems that emphasize the content needed to be + successful in the next course, MTH 111. + For this activity, Professional Competence was interpreted as the, ``knowledge, skills and attitudes necessary to enter and succeed in a defined profession or advanced academic program'' (\cite{coreoutcomes}). + \end{itemize} + During the LAC's summer peer review process, our report won awards in two categories: ``Assessment Design'' and ``Planned Improvements to Increase Student Attainment of Outcomes''. + The awards were announced at 2013 SAC Chair Inservice. + \footnote{\awardsurl} +\end{description} + +\subsection[Core Outcome assessment results]{Summarize the results of assessments of the Core Outcomes.} +As a reminder, the full reports for our assessment activity are available using the links on \cpageref{ass:sec:coreoutcomes}. + +\begin{description} + \item[2009/10: Critical Thinking \& Problem Solving] + We did not evaluate the student artifacts due to lack of time during the 2009/10 + academic year. + We intended on completing the work during 2010/11; however, since we did not have a statistically valid sample and since we wished to try a different type of assessment during 2010/11, we decided not to evaluate these artifacts. + Even though we did not evaluate student learning, the faculty members gleaned valuable information about the process of assessment. + The assessment artifacts have been saved in case the Math LAS wishes to review them to guide future work. + \item[2010/11: Critical Thinking \& Problem Solving and Communication] + \Cref{ass:tab:201011scores} presents the results of the rubric scores for our + 2011 assessment of Critical Thinking \& Problem Solving and Communication in 13 + sections of MTH 65. + \begin{table}[!htb] + \centering + \caption{2010/11 Assessment Scores}\label{ass:tab:201011scores} + \begin{tabularx}{\linewidth}{Xlll} + \toprule + Rubric Score & 1 or 2 & 3 & 4 or 5 \\ + & (below expectations) & (met expectation) & (exceeded expectation) \\ + \midrule + CT \& PS & 55\% & 35\% & 10\% \\ + Communication & 50\% & 28\% & 22\% \\ + \bottomrule + \end{tabularx} + \end{table} + + We realized that the rubric scores did not tell us specific information (e. + g., + \emph{why} did the artifact score ``below expectation'' or ``exceeded + expectation''?). + The LAC Program Assessment for Learning facilitators suggested that we do a trend analysis which produced more meaningful information. + Here are some results of the trend analysis: \begin{itemize} \item Many students did not seem to realize that not all data are linear. + \item Many students were not able to give a well-supported conclusion. + \item Students typically do not represent equivalence correctly. + \item Many students incorrectly applied the idea of percentage. + \end{itemize} + + %%Alex is here + + \item[2011/12: Self Reflection and Professional Competence] + For Self Reflection: + \begin{itemize} + \item Students are not self-critical enough. + \item There was a significant group mean difference between self-reported grade + and self-reflection behavior on all grade level differences. + Note: ``grade level'' is the self-reported grade (A, B, C, D, F, P, NP, other) for the student's previous math class. + \item There is a clear difference in the reflective thinking ability of students + in high-level math courses versus students in low-level math courses (like MTH + 20). + \end{itemize} + For Professional Competence: \begin{itemize} \item It was surprising that Engineering was chosen as ``my career interest'' by 11\% of respondents (the plurality). + Nursing and Business were both in second at 7\%. + \item Presentation skills ranked low by students as helpful in the workplace. + A good SAC discussion could center around this; we may not wish to ``force'' students to perform presentations in lower level courses where math anxiety is increased. + \end{itemize} + + \item[2012/13: Critical Thinking \& Problem Solving and Professional Competence] + % FWIW, I think you should offer this evaluation again (though of course + % modified based on what you've learned) if only to answer your own questions + % about why they did so horribly. + + Our assessment consisted of nine math problems. + After all submissions were graded, the average score was approximately 3. + 8 out of 9. + On a class-to-class basis the average had a low of 1. + 7 out of 9 to a high of 5.4 out of 9. + We were unsure of why the average of all classes was so low, and we found it alarming. + Did students not take the activity seriously since most instructors did not assign points to it? + Would it have been better to give it with the final exam when most students were prepared for a mathematics assessment? + + Data in more detail is presented graphically and with tables in section 3 of the full report, \cite{annualLASreport2012}. + Some summary points follow: \begin{itemize} \item The problems that involve working with function notation were answered correctly at a much lower rate than we expected given the amount of time dedicated to that topic in MTH 95. + \item A problem that involved linear equations was also answered correctly at a + much lower rate than we expected, as that topic is covered in MTH 60, 65 and + 95. + \item Given that time constraints made it difficult to discern a student's + conceptual understanding of a topic and our decision to mark answers as + correct or incorrect (with no ``partial credit''), we should consider altering + this activity if used again. + \end{itemize} +\end{description} + +\subsection[Assessment-driven changes]{Identify and give examples of assessment-driven changes that have + been made to improve students' attainment of the Core Outcomes.} + +Below we discuss the assessment-driven changes that came out of our annual assessment projects in academic years 2009/10, 2010/11, 2011/12, and 2012/13: + +\begin{description} \item[2009/10: Critical Thinking \& Problem Solving] + + We chose to start anew rather than analyze data that was not statistically significant. + No course-level assessment driven changes came from this years work, though the SAC did significantly modify its approach to assessment in following years due to this first year finding. + + \item[2010/11: Critical Thinking \& Problem Solving and Communication] + + During 2010/11, it became clear that the Math LAS members would not be able to develop/conduct assessment \emph{and} lead the SAC with assessment-driven changes from the prior year's work. + At the end of this academic year, the SAC created another assessment standing committee, called the Action Subcommittee. + This subcommittee will take the results and the recommendations from the previous year's Math LAS research and lead the SAC in deciding what should be changed and how to implement that change. + For 2010/11 work, only individual changes to instruction occurred from the assessment results. + (See section 1 + from the full report, \cite{annualLASreport2010}.) + + \item[2011/12: Self Reflection and Professional Competence] + + After brainstorming a list of actionable items from the 2012 research, the Action Subcommittee decided to work on the following item: ``disseminate successful ideas already used by our faculty for improving self-reflection via study skills and student-centered learning. + '' The goal was to create activities that faculty + could easily incorporate into their classes that would help students develop + self-reflection behaviors that would lead to better study skills. + Math SAC members were asked to submit activities that were already being used successfully, and the committee received 25 different activities. + During an all-day SAC meeting we split into breakout sessions and each group was asked to look over the activities and create a list of best practices for incorporating them into the classroom. + These worksheets are available for instructors to download and incorporate into their classes at \cite{selfcenteredlearning}. + Additionally, a faculty member created a series of self-reflection and study skills videos that are being used in a lot of developmental classes (see \cpageref{cur:sub:studyskills}). + + \item[2012/13: Critical Thinking \& Problem Solving and Professional Competence] + + For the complete list of actionable items from this year's research, see section 4 in the full report, \cite{annualLASreport2012}. + \begin{itemize} + \item Add to the CCOGs the expectation that students check the reasonableness of + their results (e.g., a result of $-5$ or $1{,}000{,}496$ would not be a + reasonable result for ``the number of hours driven on a weekend trip''). + Ideally, students should be encouraged to develop a habit of verifying their results regardless of whether or not the problem is a contextualized problem or not. + \item Create a minimum skills test for MTH 95. + \item Discuss methods of course content delivery in a way that supports both + full- and part-time faculty. + \item Form a Developmental Math Committee that will research different ways we + might be able to redesign our pre-college curriculum in order to better + prepare students for college level math as well as better serve students in + CTE programs. + \end{itemize} + +\end{description} + +The Action Subcommittee is currently reviewing the 2012/13 assessment work and may propose to the SAC other ideas for implementation. + diff --git a/test-cases/oneSentencePerLine/pcc-program-review5-mod2.tex b/test-cases/oneSentencePerLine/pcc-program-review5-mod2.tex new file mode 100644 index 00000000..e11dc085 --- /dev/null +++ b/test-cases/oneSentencePerLine/pcc-program-review5-mod2.tex @@ -0,0 +1,455 @@ +% arara: pdflatex: {files: [MathSACpr2014]} +% !arara: indent: {overwrite: yes} +\chapter[Outcomes and Assessment]{Reflect on learning outcomes and assessment, + teaching methodologies, and content in order to improve the quality of teaching, + learning and student success.}\label{chap:outcomes} +\epigraph{Learning outcomes assessment is key to addressing both affordability and access issues} +{Knowing What Students Know and Can Do \cite{outcomesquote}} + +\section[Course-level outcomes]{Identify and give examples of assessment-driven + changes made to improve attainment of course-level student learning outcomes. + Where key sequences exist, also include information about assessment-driven changes to those sequences.} + +The SAC has mostly concentrated on college level outcomes in the last five years for the following two reasons: +\begin{enumerate} + \item The Curriculum Committee currently requires an ``out there'' (\cite{courseoutcomes}) focus for course-level learning outcomes, with no requirement that outcomes be assessable or measurable. + \item The annual assessment reporting for the Learning Assessment Council (LAC) has focused on the College's Core Outcomes, not course outcomes. +\end{enumerate} + +However, we are fortunate to have math faculty involved with the Learning Assessment Council (LAC) and the Curriculum Committee. +This involvement has kept our SAC aware of the college's ongoing discussions regarding a possible future change for the focus of course-level learning outcomes (i.e., expectation of measurability) and related accreditation standards (e.g., \cite[Standard 4.A.3]{NWCCU}). + +Many of our current learning outcomes were developed to satisfy the requirements of an ``out there'' focus and this has resulted in oddly worded or aspirational outcomes. +Here are two examples from MTH 251 (Calculus 1): + +\begin{quote} + Appreciate derivatives and limit-related concepts that are encountered in the real world, [and] understand and be able to communicate the underlying mathematics involved to help another person gain insight into the situation. +\end{quote} +\begin{quote} + Enjoy a life enriched by exposure to Calculus. +\end{quote} + +While we hope that our students will be able to ``help another person gain insight into the situation'' and that they will ``enjoy a life enriched by exposure to Calculus,'' we recognize that outcomes like these are not easily measured. +Before our SAC can make assessment-driven changes to improve students' attainment of outcomes, we need to first develop measurable outcomes that represent the intent of our courses. + +In 2012/13 the MTH 60/65 CCOG subcommittee decided to develop course-level outcomes that were meaningful and assessable; this was done despite concerns that Curriculum Committee might reject them because they lacked the required ``out there'' focus. +The Math SAC was largely supportive of the shift to assessable outcomes, suggesting that we are supportive of the college transitioning toward a culture assessing outcomes at all levels. + +While crafting the new (\emph{draft}) course outcomes, the MTH 60/65 CCOG subcommittee connected each proposed outcome to an actual assessment activity used by a member of the committee in order to ensure that each outcome was truly measurable. +What follows are a few of the resultant (\emph{draft}) outcomes. +\begin{description} + \item[Argument Construction:] Construct and judge the validity of an argument. + (e.g., Why does a particular symbolic representation match a particular + graphical representation?) + + \item[Representational Fluency:] Demonstrate the ability to distinguish + different meanings of `variable', e.g., a variable can represent a varying + quantity in an expression or an unknown quantity in an equation. + + \item[Problem Solving:] Use appropriate (mathematical) tools in the context of + problem solving, modeling, interpreting, etc. + (Know what approach to take, what information you have, what information you need, what techniques you have to solve the problem, what the graph tells you, what the formula tells you, what model you can build). +\end{description} + +The current layout of the CCOGs does not differentiate critical content from less critical content. +To address this, the committee discussed the option of formatting the content area of the CCOGs in a pyramid structure with the most critical content highlighted at the bottom of the pyramid. + +The current CCOGs do not align the content to the course outcomes. +To help make the CCOG a better communication tool, the committee discussed making explicit connections between the course content and the course outcomes as well as explicit connections between the course outcomes and the college's core outcomes. +This work was in progress when we realized that this shift in outcomes should not be done in isolation from other courses in the pre-college math sequence; in response, we formed a DE Math Subcommittee with the goal of creating vertically aligned outcomes that created a coherent progression from MTH 20 through MTH 95. +Since its formation in June 2013 there has been a major shift in how we are hoping to approach DE level math courses. +As the Math SAC considers new math pathways for DE level students, the CCOGs for these new courses will likewise be explicitly aligned and measurable. + +In summary, we are interested in developing rich, meaningful, and measurable outcomes that better represent the intent of our courses than our current outcomes do. +Since course outcomes are required in syllabi, properly representing the intended focus for the course in the course outcomes is critical. +We hope that the conversations in the LAC and Curriculum Committee concerning course-level learning outcomes will lead to Curriculum accepting more flexible wording of course outcomes in the near future. + +\recommendation[Learning Assessment Council, Curriculum Committee]{The college should adopt a new model + for course-level learning outcomes that allow for outcomes that are more + descriptive of the actual content in the course and that are also better suited + for student-level and course-level assessment.} + +\section{Addressing College Core Outcomes} + +\subsection[Outcomes in courses and the math program]{Describe how each of the + College Core Outcomes are addressed in courses, and/or aligned with program + and/or course outcomes.} + +The college's Core Outcomes may be found at \cite{coreoutcomes}. + +\begin{description} + \item[Communication] is stated in many of our CCOGs as a course outcome. + We believe it is important for students to communicate ideas using mathematics in a meaningful manner through appropriate use of notation and concise, accurate statements. + Here are some excerpts from course outcomes in MTH CCOGs: + \begin{aquote}{MTH 111--112, MTH 211--213, MTH 251--254} {\ldots}and then interpret and clearly communicate the results. + \end{aquote} + + \begin{aquote}{MTH 243--244} + {\ldots}and clearly interpret the results via written or oral communication. + \end{aquote} + + \begin{aquote}{MTH 111--112, MTH 243--244, MTH 251--254} + {\ldots}understand and be able to communicate the underlying mathematics + involved to help another person gain insight into the situation. + \end{aquote} + + \item[Community and Environmental Responsibility] is not directly addressed in + our courses or outcomes. + Our Social Justice Workgroup (see \cpageref{cur:sub:socialJustic} and \vref{app:sec:socialJustic}) discusses issues related to teaching with community and environmental responsibility in mind. + Also, sections of MTH 111H (see \cpageref{cur:sub:111H}) have a related component involving tutoring math to someone in a student's community. + Examples of Service Learning components used by some faculty are given on \cpageref{other:sec:servicelearning}. + + \item[Critical Thinking and Problem Solving] + is fundamental to mathematics so, at first glance, it may seem that there would + be easy agreement between mathematics faculty for how this Core Outcome is + present in our curriculum. + This is not the case. + + Some PCC math faculty believe that everything in a math course is a manifestation of this Core Outcome, including practice problems intended to develop procedural fluency in a non-contextual setting (e.g., solve the quadratic equation by the Zero Product Property). + Indeed, one can certainly witness the critical analysis required within the realm of procedural fluency when students struggle with mathematical abstraction. + This happens at the most basic level, especially for students who are not detail-oriented or unable to easily generalize abstractly in a non-contextual manner. + It is also present at higher levels of math when students are faced with skill-based problems that require integration of several previously learned procedures. + + Traditionally, the main focus of most undergraduate math programs is developing a students' algebraic procedural fluency (including our current curriculum). + While procedural fluency is important, some PCC math faculty wish to narrow the focus of this Core Outcome in a way that goes beyond procedural fluency. + Some examples include the development of students' ability to solve meaningful contextualized problems, explain concepts and justify results in a mathematically sound manner, analyze mathematical patterns, or create elegant proofs. + + Assessment work has made us aware of how differently we can view critical thinking and problem solving, and it has developed our thinking considerably. + This will remain an ongoing conversation. + At this time we have chosen to take the broad view of Critical Thinking and Problem Solving that includes procedural fluency. + + \item[Cultural Awareness] is not formally covered in any of our courses. + Some individual instructors may incorporate elements of cultural awareness into their classes. + Some examples of how cultural awareness could be addressed by individual math instructors instructors are: + \begin{itemize} + \item differences in notations and procedures used by different cultures; + \item similarities and differences with regard to the use of mathematics as a tool; + \item attitudes toward mathematics in various cultures (e.g., math anxiety is not a worldwide issue); + \item history of mathematical development in various cultures and how it was influenced by dominant philosophical attitudes of the region; + \item use of mathematics as an agent of social change by shining a light on inequity with regard to treatment of, and resource allocation for, marginalized populations as compared to the dominant culture; the social justice workgroup considers this---see \cpageref{cur:sub:socialJustic} and \vref{app:sec:socialJustic}. + % I was reading recently (in the book ``Lean In'' which as it happens Chris% Chairsell gave me to read, though that book references other studies if you% need the original research) that women are less likely than men to raise% their hands in class, though they often know the answer as well as or better% than the men in class. Apparently this is also true of minority students.% You may want to consider as a SAC creating a new paradigm in future classes% banning hand-raising as a method of encouraging class participation, because% if anyone self-suppresses then the practice is ineffective to its very% purpose (of encouraging participation). Bottom line: there is more to% cultural awareness than teaching students the history of math. + \end{itemize} + + \item[Professional Competence] is described by PCC as the ability to + ``demonstrate and apply the knowledge, skills and attitudes necessary to enter + and succeed in a defined profession or advanced academic program.'' As a + discipline that builds upon prior knowledge and skills, successful completion + of any of our sequenced courses prepares students for the next math course. + A certain level of mathematical competency is valued by PCC and is required for all of our degree-seeking students. + Currently, most students show math competency by taking a math course at PCC. + In this way, the Math SAC plays a critical role in the professional competence for students' educational goals whether it be for a defined profession or advanced academic program. + Discussions about the necessary mathematical knowledge, skills and attitudes for the wide range of educational goals of PCC's students are ongoing. + % Consider adding a whole new paragraph that maybe starts ``Additionally, we + % hope to offer new new DE level courses that will focus on STEM applications + % as an integral part of learning math. This would improve student ... + + Additionally, we offer one sequence that directly addresses professional competence within math education: Our MTH 211--213 ``Foundations of Elementary Mathematics'' sequence of courses are taken by students interested in pursuing a career in teaching in the K--12 education system. + At minimum, two of the three courses are prerequisites for obtaining a degree in Education in Oregon. + Each course emphasizes specific topics of mathematical theory that are the basic building blocks of mathematics instruction in the K--12 system. + Some instructors require students to maintain a portfolio, learn multiple assessment techniques, do field observations of teachers in the K--12 system, learn about the Common Core Standards and trends in education both state and nation-wide, and are given guidance in areas such as preparing for the CBEST and PRAXIS as well as decision making in the various avenues for pursuing a degree in education. + This exposure to what the field of education actually entails helps students make sound career choices early on in their academic pursuits. + \item[Self-Reflection] + is an outcome that we believe students develop in the course of their + educational experience. + Many Math SAC faculty believe we can assist this development; others question if this should be a responsibility of faculty (or if this should even be a Core Outcome of the college). + While the SAC needs more discussion to develop a shared understanding of what Self Reflection means in the context of a mathematics course and how to develop it, we believe that it is present in our curriculum. + + We are exploring aspects of Self Reflection; here are two examples: + \begin{enumerate} + \item Development of strong study skills will improving students' ability to self-reflect; consequently, the SAC has discussed adding study skills as formal components of MTH 20 (see \cpageref{cur:sub:mth20}). + See \cpageref{cur:sub:studyskills} for more information on study skills material that incorporates student self-reflection. + \item In AY 2011/12 the Math Learning Assessment Subcommittee (Math LAS) explored Self-Regulated Learning where students were guided in a self-reflective process that helped them evaluate their depth of understanding (or lack thereof). + Although Self-Regulated Learning was not incorporated into the assessment activity (due to the complexity and the lack of time remaining), members of the Math LAS who explored this believe it is worthy of future consideration. + \end{enumerate} +\end{description} + +\subsection[Core Outcomes Mapping Matrix]{Update the Core Outcomes Mapping Matrix for your SAC as + appropriate.\footnote{\url{http://www.pcc.edu/resources/academic/core-outcomes/mapping-index.html}}} +At this time, the Learning Assessment Council expects each LDC SAC to address and assess at least four of the college's Core Outcomes somewhere in their curriculum. +As shown in our current Core Outcomes Mapping Matrix (\vref{sec:app:coreoutcomes}), most of our courses address four Core Outcomes. + +To date, most of our outcome assessment activity has been focused in our lower-level courses. +Because of this, it is difficult for us to make truly informed distinctions about variations in outcome levels through our vast array of courses. +We offer many courses at the DE level as well as many courses at the 100 and 200 levels. +While it is obvious that the skills assessed at these various levels are quite different in scope, it is not as clear that the levels of Core Outcome achievement vary in a similar way. + +Consider level 4, which is described as ``Demonstrates thorough, effective and/or sophisticated application of knowledge and skills. +'' Does that phrase come with an implied ``appropriate +to the course level being assessed''? +The assignment of levels is very dependent upon the answer to this question. +There are other questions that can be asked that could also greatly impact the way in which levels are assigned. +To wit: +\begin{itemize} + \item Pitched vs. + \ Attained: Should levels be assigned based on ``the level to + which the course is taught'' or ``the expected level of attainment for a + student who passes with a C (or B or A)''? + + \item Coverage vs. + \ Depth: If level 3 or 4 is assigned, should the Core Outcome + be a recurring theme in the course or can level 3 or 4 be reached if there is + only one or two assignments that have ``depth''? + + \item Prerequisite expectation: If a course has an expected prerequisite knowledge/skill for a particular Core Outcome, which is critical for success in the course, but not covered/developed in the course, what level should be assigned: 1 or 4? + + \item Assessment: Is there an expectation for assessment for all courses based on the assigned level (e.g., perhaps SAC-level assessment is required for courses where a level 3 or 4 is assigned)? + + \item Benchmark comparison: If we rate a course with a 200 designation as ``level 4'' for a particular outcome, is it appropriate to have a developmental education course also at level 4 or should it be at most level 2? + + \item Course-to-course comparison vs. + \ stand-alone analysis: Generally, should + a course-to-course comparison even be done? + Perhaps given the various ways Core Outcomes might manifest, a course-to-course comparison is meaningless (i.e., just as Critical Thinking and Problem Solving could be level 4 for very different reasons across disciplines, it may be possible to have level 4 for very different reasons within a single discipline). +\end{itemize} + +\recommendation[LAC, Degrees and Certificates Committee]{We recommend that the + LAC compose a concise but thorough document that precisely specifies the + context in which levels should be determined when a SAC constructs its Core + Outcomes Mapping Matrix.} + +\section[Assessment of College Core Outcomes]{For Lower Division Collegiate + (Transfer) and Developmental Education Disciplines: Assessment of College Core + Outcomes (note: Please include the full text of your annual reports as + appendices, and summarize them here).}\label{ass:sec:coreoutcomes} + +Our full annual Learning Assessment reports can be found at these links, and are summarized in the pages that follow. +\begin{description} + \item[2009/10:] \cite{annualLASreport2009} + \item[2010/11:] \cite{annualLASreport2010} + \item[2011/12:] \cite{annualLASreport2011} + \item[2012/13:] \cite{annualLASreport2012} +\end{description} + +\subsection[Core Outcome assessment design and process]{Describe the assessment design and processes that are used to + determine how well students are meeting the College Core Outcomes.} +We will discuss the evolution of the assessments by academic year, starting from 2009/10. +\begin{description} + \item [2009/10: Critical Thinking \& Problem Solving] + + This was the first year the LAC asked SACs to assess a Core Outcome. + Our assessment activity was developed by a small group of interested math faculty with minimal coordination with the full SAC. + Student artifacts were collected from the interested faculty who volunteered to give the assessment activity in their courses, and so it was not a statistically sound sample. + The activity involved both direct and indirect assessment: + \begin{itemize} + \item The direct assessment involved finding and correcting conceptual, arithmetic, and formatting mistakes in expected procedural skills for MTH 65 and MTH 95. + Students must know how to do the problem before they are able to to identify and correct mistakes. + This level of analysis is typically very difficult for students and is a high on Bloom's taxonomy. + \item The indirect assessment involved asking students to respond to questions like, ``Do you feel this class has improved your critical thinking and problem solving skills? + '' + \end{itemize} + + \item[2010/11: Critical Thinking \& Problem Solving and Communication] + + At the beginning of Fall 2010, the Math SAC decided to create a standing committee to ensure assessment work was a high priority. + The Math Learning Assessment Subcommittee (Math LAS) was born. + There were 14 members, most of whom were full-time faculty. + This was a big improvement from last year's work where only a small group of faculty participated. + + Although our previous year's CT \& PS activity had been high on Bloom's Taxonomy, we decided that procedural skills did not fully capture how we want our student to think critically about mathematics. + Instead of continuing with the previous year's work, we decided to develop a new activity for CT \& PS. + + Still very new to assessment, we did not know what type of activity might generate the most useful information. + To help us decide, we developed three assessment activities and collected student artifacts for each activity. + The chosen activity was randomly given to 12 of the 72 sections of MTH 65 held in Winter 2011. + (Note: We also created an activity for MTH 244, but there was an error in one of the questions. + Although a portion of the artifacts were evaluated, we ultimately decided to abandon this attempt and focus our limited resources toward the MTH 65 analysis.) + + For the MTH 65 assessment, we collected 240 student artifacts. + To help ensure that data would be a true SAC-level assessment (vs. + \ an evaluation of individual + instructors), faculty members were instructed to remove identifying information + from student work and submit their artifacts to an administrative assistant who + tracked submission of work only. + Sixteen members of the SAC were normed to the rubric that had been developed by the Math LAS. + Two members of the LAC's Program Assessment for Learning (PAL) facilitated this work and guided faculty through a trend analysis. + (Note: Our process and involvement of Math SAC members was so impressive as compared to other large SACs that the Learning Assessment Council awarded the Math SAC an ``Oscar'' at their Spring circus event.) + + \item[2011/12: Self Reflection and Professional Competence] + + This year we sent a survey to all students enrolled in a math class in the first week of Spring 2012. + The Math LAS was awarded a LAC grant and we used these funds to hire a consultant, Una Chi, to help us refine the survey and evaluate the student responses to the survey. + We also discussed the wording of the questions with the DE Reading and Writing faculty members to help ensure the questions would be understood by all students. + Approximately 2300 students responded to the survey, and the response rates for particular courses mirrored student enrollment in those courses and other demographic information. + The survey was an indirect measure of students' perceptions. + + For Self Reflection, we focused on questions that we felt would fit the following three areas: + \begin{enumerate} + \item Reflection---Core reflective thinking items; autonomy and relatedness aspects from self-determination theory + \item Orientation---Mastery/performance, internal/external locus of control (hold self responsible vs. + holding others responsible) + \item Competency---Belief about self-ability to perform in math + \end{enumerate} + Sample Self Reflection items on the survey: + \begin{quote} + I know when I need help on a math concept. + \end{quote} + \begin{quote} + When I get a math test back, my grade is what I expect it to be. + \end{quote} + \begin{quote} + My feelings about math affect my learning of math. + \end{quote} + + For Professional Competence, we used the suggestions of our LAC coach to craft questions about students' perceptions of math in terms of their future job and career goals. + + Sample Professional Competence items on the survey: + \begin{quote} + The skills I learn in a math class are not important to me or my future goals---I just need to pass the course. + \end{quote} + \begin{quote} + In PCC math classes, what knowledge, skills, habits or ways of thinking have you practiced that might help you in the work place? + [Choices included punctuality, + problem solving, working in groups, self discipline, career specific math + skills, interpret graphs/charts] + \end{quote} + \begin{quote} + My career interest requires some mathematical knowledge. + \end{quote} + + \item[2012/13: Critical Thinking \& Problem Solving and Professional Competence] + % On page 13 and 14 you discuss how individual course outcomes are not + % addressed due to the LAC focus on college core outcomes. But this year + % y'all totally addressed individual course outcomes, in the context of the + % CT & PS core outcome. Plus it was doubly recognized with awards. I think + % you should pull out this years' work as specifically covering course + % outcomes right upfront on page 13. + + This was our third investigation into Critical Thinking \& Problem Solving. + Our previous attempt had given us rich data, but this year we decided to investigate students' ability to solve nine math problems that specifically represent the topics covered in MTH 95 that we consider essential for success in MTH 111. + The assessment activity was administered to every face-to-face section of MTH 95 at all PCC campuses in the Winter of 2013. + We collected 677 student responses from 33 different sections across the college; all identifying information for both instructors and students were removed. + + The math problems included in the assessment were selected by faculty from our current MTH 95 textbook: + \begin{itemize} + \item For Critical Thinking \& Problem Solving: We incorporated problems that contain units and involve a real-world context. + \item For Professional Competence: We incorporated problems that emphasize the content needed to be successful in the next course, MTH 111. + For this activity, Professional Competence was interpreted as the, ``knowledge, skills and attitudes necessary to enter and succeed in a defined profession or advanced academic program'' (\cite{coreoutcomes}). + \end{itemize} + During the LAC's summer peer review process, our report won awards in two categories: ``Assessment Design'' and ``Planned Improvements to Increase Student Attainment of Outcomes''. + The awards were announced at 2013 SAC Chair Inservice. + \footnote{\awardsurl} +\end{description} + +\subsection[Core Outcome assessment results]{Summarize the results of assessments of the Core Outcomes.} +As a reminder, the full reports for our assessment activity are available using the links on \cpageref{ass:sec:coreoutcomes}. + +\begin{description} + \item[2009/10: Critical Thinking \& Problem Solving] + We did not evaluate the student artifacts due to lack of time during the 2009/10 + academic year. + We intended on completing the work during 2010/11; however, since we did not have a statistically valid sample and since we wished to try a different type of assessment during 2010/11, we decided not to evaluate these artifacts. + Even though we did not evaluate student learning, the faculty members gleaned valuable information about the process of assessment. + The assessment artifacts have been saved in case the Math LAS wishes to review them to guide future work. + \item[2010/11: Critical Thinking \& Problem Solving and Communication] + \Cref{ass:tab:201011scores} presents the results of the rubric scores for our + 2011 assessment of Critical Thinking \& Problem Solving and Communication in 13 + sections of MTH 65. + \begin{table}[!htb] + \centering + \caption{2010/11 Assessment Scores}\label{ass:tab:201011scores} + \begin{tabularx}{\linewidth}{Xlll} + \toprule + Rubric Score & 1 or 2 & 3 & 4 or 5 \\ + & (below expectations) & (met expectation) & (exceeded expectation) \\ + \midrule + CT \& PS & 55\% & 35\% & 10\% \\ + Communication & 50\% & 28\% & 22\% \\ + \bottomrule + \end{tabularx} + \end{table} + + We realized that the rubric scores did not tell us specific information (e.g., \emph{why} did the artifact score ``below expectation'' or ``exceeded expectation''? + ). + The LAC Program Assessment for Learning facilitators suggested that we do a trend analysis which produced more meaningful information. + Here are some results of the trend analysis: + \begin{itemize} + \item Many students did not seem to realize that not all data are linear. + \item Many students were not able to give a well-supported conclusion. + \item Students typically do not represent equivalence correctly. + \item Many students incorrectly applied the idea of percentage. + \end{itemize} + + %%Alex is here + + \item[2011/12: Self Reflection and Professional Competence] + For Self Reflection: + \begin{itemize} + \item Students are not self-critical enough. + \item There was a significant group mean difference between self-reported grade and self-reflection behavior on all grade level differences. + Note: ``grade level'' is the self-reported grade (A, B, C, D, F, P, NP, other) for the student's previous math class. + \item There is a clear difference in the reflective thinking ability of students in high-level math courses versus students in low-level math courses (like MTH 20). + \end{itemize} + For Professional Competence: + \begin{itemize} + \item It was surprising that Engineering was chosen as ``my career interest'' by 11\% of respondents (the plurality). + Nursing and Business were both in second at 7\%. + \item Presentation skills ranked low by students as helpful in the workplace. + A good SAC discussion could center around this; we may not wish to ``force'' students to perform presentations in lower level courses where math anxiety is increased. + \end{itemize} + + \item[2012/13: Critical Thinking \& Problem Solving and Professional Competence] + % FWIW, I think you should offer this evaluation again (though of course + % modified based on what you've learned) if only to answer your own questions + % about why they did so horribly. + + Our assessment consisted of nine math problems. + After all submissions were graded, the average score was approximately 3.8 out of 9. + On a class-to-class basis the average had a low of 1.7 out of 9 to a high of 5.4 out of 9. + We were unsure of why the average of all classes was so low, and we found it alarming. + Did students not take the activity seriously since most instructors did not assign points to it? + Would it have been better to give it with the final exam when most students were prepared for a mathematics assessment? + + Data in more detail is presented graphically and with tables in section 3 of the full report, \cite{annualLASreport2012}. + Some summary points follow: + \begin{itemize} + \item The problems that involve working with function notation were answered correctly at a much lower rate than we expected given the amount of time dedicated to that topic in MTH 95. + \item A problem that involved linear equations was also answered correctly at a much lower rate than we expected, as that topic is covered in MTH 60, 65 and 95. + \item Given that time constraints made it difficult to discern a student's conceptual understanding of a topic and our decision to mark answers as correct or incorrect (with no ``partial credit''), we should consider altering this activity if used again. + \end{itemize} +\end{description} + +\subsection[Assessment-driven changes]{Identify and give examples of assessment-driven changes that have + been made to improve students' attainment of the Core Outcomes.} + +Below we discuss the assessment-driven changes that came out of our annual assessment projects in academic years 2009/10, 2010/11, 2011/12, and 2012/13: + +\begin{description} + \item[2009/10: Critical Thinking \& Problem Solving] + + We chose to start anew rather than analyze data that was not statistically significant. + No course-level assessment driven changes came from this years work, though the SAC did significantly modify its approach to assessment in following years due to this first year finding. + + \item[2010/11: Critical Thinking \& Problem Solving and Communication] + + During 2010/11, it became clear that the Math LAS members would not be able to develop/conduct assessment \emph{and} lead the SAC with assessment-driven changes from the prior year's work. + At the end of this academic year, the SAC created another assessment standing committee, called the Action Subcommittee. + This subcommittee will take the results and the recommendations from the previous year's Math LAS research and lead the SAC in deciding what should be changed and how to implement that change. + For 2010/11 work, only individual changes to instruction occurred from the assessment results. + (See section 1 from the full report, \cite{annualLASreport2010}.) + + \item[2011/12: Self Reflection and Professional Competence] + + After brainstorming a list of actionable items from the 2012 research, the Action Subcommittee decided to work on the following item: ``disseminate successful ideas already used by our faculty for improving self-reflection via study skills and student-centered learning. + '' The goal was to create activities that faculty + could easily incorporate into their classes that would help students develop + self-reflection behaviors that would lead to better study skills. + Math SAC members were asked to submit activities that were already being used successfully, and the committee received 25 different activities. + During an all-day SAC meeting we split into breakout sessions and each group was asked to look over the activities and create a list of best practices for incorporating them into the classroom. + These worksheets are available for instructors to download and incorporate into their classes at \cite{selfcenteredlearning}. + Additionally, a faculty member created a series of self-reflection and study skills videos that are being used in a lot of developmental classes (see \cpageref{cur:sub:studyskills}). + + \item[2012/13: Critical Thinking \& Problem Solving and Professional Competence] + + For the complete list of actionable items from this year's research, see section 4 in the full report, \cite{annualLASreport2012}. + \begin{itemize} + \item Add to the CCOGs the expectation that students check the reasonableness of their results (e.g., a result of $-5$ or $1{,}000{,}496$ would not be a reasonable result for ``the number of hours driven on a weekend trip''). + Ideally, students should be encouraged to develop a habit of verifying their results regardless of whether or not the problem is a contextualized problem or not. + \item Create a minimum skills test for MTH 95. + \item Discuss methods of course content delivery in a way that supports both full- and part-time faculty. + \item Form a Developmental Math Committee that will research different ways we might be able to redesign our pre-college curriculum in order to better prepare students for college level math as well as better serve students in CTE programs. + \end{itemize} + +\end{description} + +The Action Subcommittee is currently reviewing the 2012/13 assessment work and may propose to the SAC other ideas for implementation. + diff --git a/test-cases/oneSentencePerLine/pcc-program-review5.tex b/test-cases/oneSentencePerLine/pcc-program-review5.tex new file mode 100644 index 00000000..3331ea1b --- /dev/null +++ b/test-cases/oneSentencePerLine/pcc-program-review5.tex @@ -0,0 +1,638 @@ +% arara: pdflatex: {files: [MathSACpr2014]} +% !arara: indent: {overwrite: yes} +\chapter[Outcomes and Assessment]{Reflect on learning outcomes and assessment, + teaching methodologies, and content in order to improve the quality of teaching, + learning and student success.}\label{chap:outcomes} +\epigraph{Learning outcomes assessment is key to addressing both affordability and access issues} +{Knowing What Students Know and Can Do \cite{outcomesquote}} + +\section[Course-level outcomes]{Identify and give examples of assessment-driven + changes made to improve attainment of course-level student learning outcomes. + Where key sequences exist, also include information about assessment-driven +changes to those sequences.} + +The SAC has mostly concentrated on college level outcomes in +the last five years for the following two reasons: +\begin{enumerate} + \item The Curriculum Committee currently requires an ``out there'' + (\cite{courseoutcomes}) focus for course-level learning outcomes, with no + requirement that outcomes be assessable or measurable. + \item The annual assessment reporting for the Learning Assessment Council (LAC) + has focused on the College's Core Outcomes, not course outcomes. +\end{enumerate} + +However, we are fortunate to have math faculty involved with the Learning +Assessment Council (LAC) and the Curriculum Committee. This involvement has kept +our SAC aware of the college's ongoing discussions regarding a possible future +change for the focus of course-level learning outcomes (i.e., expectation of +measurability) and related accreditation standards (e.g., \cite[Standard +4.A.3]{NWCCU}). + +Many of our current learning outcomes were developed to satisfy the requirements +of an ``out there'' focus and this has resulted in oddly worded or aspirational +outcomes. Here are two examples from MTH 251 (Calculus 1): + +\begin{quote} + Appreciate derivatives and limit-related concepts that are encountered in the + real world, [and] understand and be able to communicate the underlying + mathematics involved to help another person gain insight into the situation. +\end{quote} +\begin{quote} + Enjoy a life enriched by exposure to Calculus. +\end{quote} + +While we hope that our students will be able to ``help another person gain +insight into the situation'' and that they will ``enjoy a life enriched by +exposure to Calculus,'' we recognize that outcomes like these are not easily +measured. Before our SAC can make assessment-driven changes to improve students' +attainment of outcomes, we need to first develop measurable outcomes that +represent the intent of our courses. + +In 2012/13 the MTH 60/65 CCOG subcommittee decided to develop course-level +outcomes that were meaningful and assessable; this was done despite concerns +that Curriculum Committee might reject them because they lacked the required +``out there'' focus. The Math SAC was largely supportive of the shift to +assessable outcomes, suggesting that we are supportive of the college +transitioning toward a culture assessing outcomes at all levels. + +While crafting the new (\emph{draft}) course outcomes, the MTH 60/65 CCOG +subcommittee connected each proposed outcome to an actual assessment activity +used by a member of the committee in order to ensure that each outcome was truly +measurable. What follows are a few of the resultant (\emph{draft}) outcomes. +\begin{description} + \item[Argument Construction:] Construct and judge the validity of an argument. + (e.g., Why does a particular symbolic representation match a particular + graphical representation?) + + \item[Representational Fluency:] Demonstrate the ability to distinguish + different meanings of `variable', e.g., a variable can represent a varying + quantity in an expression or an unknown quantity in an equation. + + \item[Problem Solving:] Use appropriate (mathematical) tools in the context of + problem solving, modeling, interpreting, etc. (Know what approach to take, + what information you have, what information you need, what techniques you have + to solve the problem, what the graph tells you, what the formula tells you, + what model you can build). +\end{description} + +The current layout of the CCOGs does not differentiate critical content from +less critical content. To address this, the committee discussed the option of +formatting the content area of the CCOGs in a pyramid structure with the most +critical content highlighted at the bottom of the pyramid. + +The current CCOGs do not align the content to the course outcomes. To help +make the CCOG a better communication tool, the committee discussed making +explicit connections between the course content and the course outcomes as well +as explicit connections between the course outcomes and the college's core +outcomes. This work was in progress when we realized that this shift in +outcomes should not be done in isolation from other courses in the pre-college +math sequence; in response, we formed a DE Math Subcommittee with the goal of +creating vertically aligned outcomes that created a coherent progression from +MTH 20 through MTH 95. Since its formation in June 2013 there has been a major +shift in how we are hoping to approach DE level math courses. As the Math SAC +considers new math pathways for DE level students, the CCOGs for these new +courses will likewise be explicitly aligned and measurable. + +In summary, we are interested in developing rich, meaningful, and measurable +outcomes that better represent the intent of our courses than our current +outcomes do. Since course outcomes are required in syllabi, properly +representing the intended focus for the course in the course outcomes is +critical. We hope that the conversations in the LAC and Curriculum Committee +concerning course-level learning outcomes will lead to Curriculum accepting more +flexible wording of course outcomes in the near future. + +\recommendation[Learning Assessment Council, Curriculum Committee]{The college should adopt a new model + for course-level learning outcomes that allow for outcomes that are more + descriptive of the actual content in the course and that are also better suited +for student-level and course-level assessment.} + +\section{Addressing College Core Outcomes} + +\subsection[Outcomes in courses and the math program]{Describe how each of the + College Core Outcomes are addressed in courses, and/or aligned with program +and/or course outcomes.} + +The college's Core Outcomes may be found at \cite{coreoutcomes}. + +\begin{description} + \item[Communication] is stated in many of our CCOGs as a course outcome. We + believe it is important for students to communicate ideas using mathematics in + a meaningful manner through appropriate use of notation and concise, accurate + statements. Here are some excerpts from course outcomes in MTH CCOGs: + \begin{aquote}{MTH 111--112, MTH 211--213, MTH 251--254} + {\ldots}and then interpret and clearly communicate the results. + \end{aquote} + + \begin{aquote}{MTH 243--244} + {\ldots}and clearly interpret the results via written or oral communication. + \end{aquote} + + \begin{aquote}{MTH 111--112, MTH 243--244, MTH 251--254} + {\ldots}understand and be able to communicate the underlying mathematics + involved to help another person gain insight into the situation. + \end{aquote} + + \item[Community and Environmental Responsibility] is not directly addressed in + our courses or outcomes. Our Social Justice Workgroup + (see \cpageref{cur:sub:socialJustic} and \vref{app:sec:socialJustic}) discusses issues + related to teaching with community and environmental responsibility in mind. + Also, sections of MTH 111H (see \cpageref{cur:sub:111H}) have a related component + involving tutoring math to someone in a student's community. Examples of + Service Learning components used by some faculty are given on \cpageref{other:sec:servicelearning}. + + \item[Critical Thinking and Problem Solving] + is fundamental to mathematics so, at first glance, it may seem that there would + be easy agreement between mathematics faculty for how this Core Outcome is + present in our curriculum. This is not the case. + + Some PCC math faculty believe that everything in a math course is a + manifestation of this Core Outcome, including practice problems intended to + develop procedural fluency in a non-contextual setting (e.g., solve the quadratic + equation by the Zero Product Property). Indeed, one can certainly witness the + critical analysis required within the realm of procedural fluency when students + struggle with mathematical abstraction. This happens at the most basic level, + especially for students who are not detail-oriented or unable to easily + generalize abstractly in a non-contextual manner. It is also present at higher + levels of math when students are faced with skill-based problems that require + integration of several previously learned procedures. + + Traditionally, the main focus of most undergraduate math programs is developing + a students' algebraic procedural fluency (including our current curriculum). + While procedural fluency is important, some PCC math faculty wish to narrow the + focus of this Core Outcome in a way that goes beyond procedural fluency. Some + examples include the development of students' ability to solve meaningful + contextualized problems, explain concepts and justify results in a + mathematically sound manner, analyze mathematical patterns, or create elegant + proofs. + + Assessment work has made us aware of how differently we can view critical + thinking and problem solving, and it has developed our thinking considerably. + This will remain an ongoing conversation. At this time we have chosen to take + the broad view of Critical Thinking and Problem Solving that includes + procedural fluency. + + \item[Cultural Awareness] is not formally covered in any of our courses. Some + individual instructors may incorporate elements of cultural awareness into + their classes. Some examples of how cultural awareness could be addressed by + individual math instructors instructors are: + % I was reading recently (in the book ``Lean In'' which as it happens Chris + % Chairsell gave me to read, though that book references other studies if you + % need the original research) that women are less likely than men to raise + % their hands in class, though they often know the answer as well as or better + % than the men in class. Apparently this is also true of minority students. + % You may want to consider as a SAC creating a new paradigm in future classes + % banning hand-raising as a method of encouraging class participation, because + % if anyone self-suppresses then the practice is ineffective to its very + % purpose (of encouraging participation). Bottom line: there is more to + % cultural awareness than teaching students the history of math. + \begin{itemize} + \item differences in notations and procedures used by different cultures; + \item similarities and differences with regard to the use of mathematics as a + tool; + \item attitudes toward mathematics in various cultures (e.g., math anxiety is + not a worldwide issue); + \item history of mathematical development in various cultures and how it was + influenced by dominant philosophical attitudes of the region; + \item use of mathematics as an agent of social change by shining a light on + inequity with regard to treatment of, and resource allocation for, + marginalized populations as compared to the dominant culture; the social + justice workgroup considers this---see \cpageref{cur:sub:socialJustic} and + \vref{app:sec:socialJustic}. + \end{itemize} + + \item[Professional Competence] is described by PCC as the ability to + ``demonstrate and apply the knowledge, skills and attitudes necessary to enter + and succeed in a defined profession or advanced academic program.'' As a + discipline that builds upon prior knowledge and skills, successful completion + of any of our sequenced courses prepares students for the next math course. A + certain level of mathematical competency is valued by PCC and is required for + all of our degree-seeking students. Currently, most students show math + competency by taking a math course at PCC. In this way, the Math SAC plays a + critical role in the professional competence for students' educational goals + whether it be for a defined profession or advanced academic program. + Discussions about the necessary mathematical knowledge, skills and attitudes + for the wide range of educational goals of PCC's students are ongoing. + % Consider adding a whole new paragraph that maybe starts ``Additionally, we + % hope to offer new new DE level courses that will focus on STEM applications + % as an integral part of learning math. This would improve student ... + + Additionally, we offer one sequence that directly addresses professional + competence within math education: Our MTH 211--213 ``Foundations of Elementary + Mathematics'' sequence of courses are taken by students interested in pursuing a + career in teaching in the K--12 education system. At minimum, two of the three + courses are prerequisites for obtaining a degree in Education in Oregon. Each + course emphasizes specific topics of mathematical theory that are the basic + building blocks of mathematics instruction in the K--12 system. Some + instructors require students to maintain a portfolio, learn multiple assessment + techniques, do field observations of teachers in the K--12 system, learn about + the Common Core Standards and trends in education both state and nation-wide, + and are given guidance in areas such as preparing for the CBEST and PRAXIS as + well as decision making in the various avenues for pursuing a degree in + education. This exposure to what the field of education actually entails + helps students make sound career choices early on in their academic pursuits. + \item[Self-Reflection] + is an outcome that we believe students develop in the course of their + educational experience. Many Math SAC faculty believe we can assist this + development; others question if this should be a responsibility of faculty + (or if this should even be a Core Outcome of the college). While the SAC + needs more discussion to develop a shared understanding of what Self + Reflection means in the context of a mathematics course and how to develop + it, we believe that it is present in our curriculum. + + We are exploring aspects of Self Reflection; here are two examples: + \begin{enumerate} + \item + Development of strong study skills will improving students' ability to self-reflect; consequently, + the SAC has discussed adding study skills as formal components + of MTH 20 (see \cpageref{cur:sub:mth20}). See \cpageref{cur:sub:studyskills} + for more information on study skills material that incorporates student + self-reflection. + \item + In AY 2011/12 the Math Learning Assessment Subcommittee (Math LAS) explored + Self-Regulated Learning where students were guided in a self-reflective + process that helped them evaluate their depth of understanding (or lack + thereof). Although Self-Regulated Learning was not incorporated into the + assessment activity (due to the complexity and the lack of time remaining), + members of the Math LAS who explored this believe it is worthy of future + consideration. + \end{enumerate} +\end{description} + +\subsection[Core Outcomes Mapping Matrix]{Update the Core Outcomes Mapping Matrix for your SAC as +appropriate.\footnote{\url{http://www.pcc.edu/resources/academic/core-outcomes/mapping-index.html}}} +At this time, the Learning Assessment Council expects each LDC SAC to address and assess at least four of the college's Core Outcomes somewhere in their curriculum. As shown in our current Core Outcomes Mapping Matrix (\vref{sec:app:coreoutcomes}), most of our courses address four Core Outcomes. + +To date, most of our outcome assessment activity has been focused in our +lower-level courses. Because of this, it is difficult for us to make truly +informed distinctions about variations in outcome levels through our vast array +of courses. We offer many courses at the DE level as well as many courses at +the 100 and 200 levels. While it is obvious that the skills assessed at these +various levels are quite different in scope, it is not as clear that the levels +of Core Outcome achievement vary in a similar way. + +Consider level 4, which is described as ``Demonstrates thorough, effective +and/or sophisticated application +of knowledge and skills.'' Does that phrase come with an implied ``appropriate +to the course level being assessed''? The assignment of levels is very +dependent upon the answer to this question. There are other questions that can +be asked that could also greatly impact the way in which levels are assigned. +To wit: +\begin{itemize} +\item Pitched vs.\ Attained: Should levels be assigned based on ``the level to + which the course is taught'' or ``the expected level of attainment for a + student who passes with a C (or B or A)''? + +\item Coverage vs.\ Depth: If level 3 or 4 is assigned, should the Core Outcome + be a recurring theme in the course or can level 3 or 4 be reached if there is + only one or two assignments that have ``depth''? + +\item Prerequisite expectation: If a course has an expected prerequisite + knowledge/skill for a particular Core Outcome, which is critical for success + in the course, but not covered/developed in the course, what level should be + assigned: 1 or 4? + +\item Assessment: Is there an expectation for assessment for all courses based + on the assigned level (e.g., perhaps SAC-level assessment is required for + courses where a level 3 or 4 is assigned)? + +\item Benchmark comparison: If we rate a course with a 200 designation as + ``level 4'' for a particular outcome, is it appropriate to have a + developmental education course also at level 4 or should it be at most level + 2? + +\item Course-to-course comparison vs.\ stand-alone analysis: Generally, should + a course-to-course comparison even be done? Perhaps given the various ways + Core Outcomes might manifest, a course-to-course comparison is meaningless + (i.e., just as Critical Thinking and Problem Solving could be level 4 for + very different reasons across disciplines, it may be possible to have level 4 + for very different reasons within a single discipline). +\end{itemize} + +\recommendation[LAC, Degrees and Certificates Committee]{We recommend that the +LAC compose a concise but thorough document that precisely specifies the +context in which levels should be determined when a SAC constructs its Core +Outcomes Mapping Matrix.} + +\section[Assessment of College Core Outcomes]{For Lower Division Collegiate + (Transfer) and Developmental Education Disciplines: Assessment of College Core + Outcomes (note: Please include the full text of your annual reports as + appendices, and summarize them here).}\label{ass:sec:coreoutcomes} + +Our full annual Learning Assessment reports can be found at these links, and +are summarized in the pages that follow. +\begin{description} + \item[2009/10:] \cite{annualLASreport2009} + \item[2010/11:] \cite{annualLASreport2010} + \item[2011/12:] \cite{annualLASreport2011} + \item[2012/13:] \cite{annualLASreport2012} +\end{description} + +\subsection[Core Outcome assessment design and process]{Describe the assessment design and processes that are used to +determine how well students are meeting the College Core Outcomes.} +We will discuss the evolution of the assessments by academic year, starting +from 2009/10. +\begin{description} + \item [2009/10: Critical Thinking \& Problem Solving] + + This was the first year the LAC asked SACs to assess a Core Outcome. Our + assessment activity was developed by a small group of interested math faculty + with minimal coordination with the full SAC. Student artifacts were collected + from the interested faculty who volunteered to give the assessment activity in + their courses, and so it was not a statistically sound sample. The activity + involved both direct and indirect assessment: + \begin{itemize} + \item The direct assessment involved finding and correcting conceptual, + arithmetic, and formatting mistakes in expected procedural skills for MTH 65 + and MTH 95. Students must know how to do the problem before they are able to + to identify and correct mistakes. This level of analysis is typically very + difficult for students and is a high on Bloom's taxonomy. + \item The indirect assessment involved asking students to respond to questions + like, ``Do you feel this class has improved your critical thinking and problem + solving skills?'' + \end{itemize} + + \item[2010/11: Critical Thinking \& Problem Solving and Communication] + + At the beginning of Fall 2010, the Math SAC decided to create a standing + committee to ensure assessment work was a high priority. The Math Learning + Assessment Subcommittee (Math LAS) was born. There were 14 members, most of + whom were full-time faculty. This was a big improvement from last year's work + where only a small group of faculty participated. + + Although our previous year's CT \& PS activity had been high on Bloom's + Taxonomy, we decided that procedural skills did not fully capture how we want + our student to think critically about mathematics. Instead of continuing with + the previous year's work, we decided to develop a new activity for CT \& PS. + + Still very new to assessment, we did not know what type of activity might + generate the most useful information. To help us decide, we developed three + assessment activities and collected student artifacts for each activity. The + chosen activity was randomly given to 12 of the 72 sections of MTH 65 held in + Winter 2011. (Note: We also created an activity for MTH 244, but there was an + error in one of the questions. Although a portion of the artifacts were + evaluated, we ultimately decided to abandon this attempt and focus our limited + resources toward the MTH 65 analysis.) + + For the MTH 65 assessment, we collected 240 student artifacts. To help ensure + that data would be a true SAC-level assessment (vs.\ an evaluation of individual + instructors), faculty members were instructed to remove identifying information + from student work and submit their artifacts to an administrative assistant who + tracked submission of work only. Sixteen members of the SAC were normed to the + rubric that had been developed by the Math LAS. Two members of the LAC's + Program Assessment for Learning (PAL) facilitated this work and guided faculty + through a trend analysis. (Note: Our process and involvement of Math SAC + members was so impressive as compared to other large SACs that the Learning + Assessment Council awarded the Math SAC an ``Oscar'' at their Spring circus + event.) + + \item[2011/12: Self Reflection and Professional Competence] + + This year we sent a survey to all students enrolled in a math class in the first + week of Spring 2012. The Math LAS was awarded a LAC grant and we used these + funds to hire a consultant, Una Chi, to help us refine the survey and evaluate + the student responses to the survey. We also discussed the wording of the + questions with the DE Reading and Writing faculty members to help ensure the + questions would be understood by all students. Approximately 2300 students + responded to the survey, and the response rates for particular courses mirrored + student enrollment in those courses and other demographic information. The + survey was an indirect measure of students' perceptions. + + For Self Reflection, we focused on questions that we felt would fit the + following three areas: + \begin{enumerate} + \item Reflection---Core reflective thinking items; autonomy and relatedness + aspects from self-determination theory + \item Orientation---Mastery/performance, internal/external locus of control + (hold self responsible vs. holding others responsible) + \item Competency---Belief about self-ability to perform in math + \end{enumerate} + Sample Self Reflection items on the survey: + \begin{quote} + I know when I need help on a math concept. + \end{quote} + \begin{quote} + When I get a math test back, my grade is what I expect it to be. + \end{quote} + \begin{quote} + My feelings about math affect my learning of math. + \end{quote} + + For Professional Competence, we used the suggestions of our LAC coach to craft + questions about students' perceptions of math in terms of their future + job and career goals. + + Sample Professional Competence items on the survey: + \begin{quote} + The skills I learn in a math class are not important to me or my future goals---I just need to pass the course. + \end{quote} + \begin{quote} + In PCC math classes, what knowledge, skills, habits or ways of thinking have you + practiced that might help you in the work place? [Choices included punctuality, + problem solving, working in groups, self discipline, career specific math + skills, interpret graphs/charts] + \end{quote} + \begin{quote} + My career interest requires some mathematical knowledge. + \end{quote} + + \item[2012/13: Critical Thinking \& Problem Solving and Professional Competence] + % On page 13 and 14 you discuss how individual course outcomes are not + % addressed due to the LAC focus on college core outcomes. But this year + % y'all totally addressed individual course outcomes, in the context of the + % CT & PS core outcome. Plus it was doubly recognized with awards. I think + % you should pull out this years' work as specifically covering course + % outcomes right upfront on page 13. + + This was our third investigation into Critical Thinking \& Problem Solving. Our previous attempt had given + us rich data, but this year we decided to investigate students' ability to solve + nine math problems that specifically represent the topics covered in MTH 95 that + we consider essential for success in MTH 111. The assessment activity was + administered to every face-to-face section of MTH 95 at all PCC campuses in the + Winter of 2013. We collected 677 student responses from 33 different sections + across the college; all identifying information for both instructors and + students were removed. + + The math problems included in the assessment were selected by faculty from our + current MTH 95 textbook: + \begin{itemize} + \item For Critical Thinking \& Problem Solving: We incorporated problems that contain units and involve a + real-world context. + \item For Professional Competence: We incorporated problems that emphasize the content needed to be + successful in the next course, MTH 111. For this activity, Professional + Competence was interpreted as the, ``knowledge, skills and attitudes necessary + to enter and succeed in a defined profession or advanced academic program'' + (\cite{coreoutcomes}). + \end{itemize} + During the LAC's summer peer review process, our report won awards in two + categories: ``Assessment Design'' and ``Planned Improvements to Increase Student + Attainment of Outcomes''. The awards were announced at 2013 SAC Chair + Inservice.\footnote{\awardsurl} +\end{description} + +\subsection[Core Outcome assessment results]{Summarize the results of assessments of the Core Outcomes.} +As a reminder, the full reports for our assessment activity are available using +the links on \cpageref{ass:sec:coreoutcomes}. + +\begin{description} + \item[2009/10: Critical Thinking \& Problem Solving] + We did not evaluate the student artifacts due to lack of time during the 2009/10 + academic year. We intended on completing the work during 2010/11; however, since + we did not have a statistically valid sample and since we wished to try a + different type of assessment during 2010/11, we decided not to evaluate these + artifacts. Even though we did not evaluate student learning, the faculty + members gleaned valuable information about the process of assessment. The + assessment artifacts have been saved in case the Math LAS wishes to review them + to guide future work. + \item[2010/11: Critical Thinking \& Problem Solving and Communication] + \Cref{ass:tab:201011scores} presents the results of the rubric scores for our + 2011 assessment of Critical Thinking \& Problem Solving and Communication in 13 + sections of MTH 65. + \begin{table}[!htb] + \centering + \caption{2010/11 Assessment Scores}\label{ass:tab:201011scores} + \begin{tabularx}{\linewidth}{Xlll} + \toprule + Rubric Score & 1 or 2 & 3 & 4 or 5 \\ + & (below expectations) & (met expectation) & (exceeded expectation) \\ + \midrule + CT \& PS & 55\% & 35\% & 10\% \\ + Communication & 50\% & 28\% & 22\% \\ + \bottomrule + \end{tabularx} + \end{table} + + We realized that the rubric scores did not tell us specific information (e.g., + \emph{why} did the artifact score ``below expectation'' or ``exceeded + expectation''?). The LAC Program Assessment for Learning facilitators + suggested that we do a trend analysis which produced more meaningful + information. Here are some results of the trend analysis: + \begin{itemize} + \item Many students did not seem to realize that not all data are linear. + \item Many students were not able to give a well-supported conclusion. + \item Students typically do not represent equivalence correctly. + \item Many students incorrectly applied the idea of percentage. + \end{itemize} + + %%Alex is here + + \item[2011/12: Self Reflection and Professional Competence] + For Self Reflection: + \begin{itemize} + \item Students are not self-critical enough. + \item There was a significant group mean difference between self-reported grade + and self-reflection behavior on all grade level differences. Note: ``grade + level'' is the self-reported grade (A, B, C, D, F, P, NP, other) for the + student's previous math class. + \item There is a clear difference in the reflective thinking ability of students + in high-level math courses versus students in low-level math courses (like MTH + 20). + \end{itemize} + For Professional Competence: + \begin{itemize} + \item It was surprising that Engineering was chosen as ``my career interest'' by + 11\% of respondents (the plurality). Nursing and Business were both in second + at 7\%. + \item Presentation skills ranked low by students as helpful in the workplace. + A good SAC discussion could center around this; we may not + wish to ``force'' students to perform presentations in lower level courses where math + anxiety is increased. + \end{itemize} + + \item[2012/13: Critical Thinking \& Problem Solving and Professional Competence] + % FWIW, I think you should offer this evaluation again (though of course + % modified based on what you've learned) if only to answer your own questions + % about why they did so horribly. + + Our assessment consisted of nine math problems. After all submissions were + graded, the average score was approximately 3.8 out of 9. On a class-to-class + basis the average had a low of 1.7 out of 9 to a high of 5.4 out of 9. We were + unsure of why the average of all classes was so low, and we found it alarming. + Did students not take the activity seriously since most instructors did not + assign points to it? Would it have been better to give it with the final exam + when most students were prepared for a mathematics assessment? + + Data in more detail is presented graphically and with tables in section 3 of the + full report, \cite{annualLASreport2012}. Some summary points follow: + \begin{itemize} + \item The problems that involve working with function notation were answered + correctly at a much lower rate than we expected given the amount of time + dedicated to that topic in MTH 95. + \item A problem that involved linear equations was also answered correctly at a + much lower rate than we expected, as that topic is covered in MTH 60, 65 and + 95. + \item Given that time constraints made it difficult to discern a student's + conceptual understanding of a topic and our decision to mark answers as + correct or incorrect (with no ``partial credit''), we should consider altering + this activity if used again. + \end{itemize} +\end{description} + +\subsection[Assessment-driven changes]{Identify and give examples of assessment-driven changes that have +been made to improve students' attainment of the Core Outcomes.} + +Below we discuss the assessment-driven changes that came out of our annual +assessment projects in academic years 2009/10, 2010/11, 2011/12, and 2012/13: + +\begin{description} + \item[2009/10: Critical Thinking \& Problem Solving] + + We chose to start anew rather than analyze data that was not statistically + significant. No course-level assessment driven changes came from this years + work, though the SAC did significantly modify its approach to assessment in + following years due to this first year finding. + + \item[2010/11: Critical Thinking \& Problem Solving and Communication] + + During 2010/11, it became clear that the Math LAS members would not be able to + develop/conduct assessment \emph{and} lead the SAC with assessment-driven + changes from the prior year's work. At the end of this academic year, the SAC + created another assessment standing committee, called the Action Subcommittee. + This subcommittee will take the results and the recommendations from the + previous year's Math LAS research and lead the SAC in deciding what should be + changed and how to implement that change. For 2010/11 work, only individual + changes to instruction occurred from the assessment results. (See section 1 + from the full report, \cite{annualLASreport2010}.) + + \item[2011/12: Self Reflection and Professional Competence] + + After brainstorming a list of actionable items from the 2012 research, the + Action Subcommittee decided to work on the following item: ``disseminate successful ideas + already used by our faculty for improving self-reflection via study skills and + student-centered learning.'' The goal was to create activities that faculty + could easily incorporate into their classes that would help students develop + self-reflection behaviors that would lead to better study skills. Math SAC + members were asked to submit activities that were already being used + successfully, and the committee received 25 different activities. During an + all-day SAC meeting we split into breakout sessions and each group was asked to + look over the activities and create a list of best practices for incorporating + them into the classroom. These worksheets are available for instructors to + download and incorporate into their classes at \cite{selfcenteredlearning}. + Additionally, a faculty member created a series of self-reflection and study + skills videos that are being used in a lot of developmental classes (see + \cpageref{cur:sub:studyskills}). + + \item[2012/13: Critical Thinking \& Problem Solving and Professional Competence] + + For the complete list of actionable items from this year's research, see section + 4 in the full report, \cite{annualLASreport2012}. + \begin{itemize} + \item Add to the CCOGs the expectation that students check the reasonableness of + their results (e.g., a result of $-5$ or $1{,}000{,}496$ would not be a + reasonable result for ``the number of hours driven on a weekend trip''). + Ideally, students should be encouraged to develop a habit of verifying their + results regardless of whether or not the problem is a contextualized problem + or not. + \item Create a minimum skills test for MTH 95. + \item Discuss methods of course content delivery in a way that supports both + full- and part-time faculty. + \item Form a Developmental Math Committee that will research different ways we + might be able to redesign our pre-college curriculum in order to better + prepare students for college level math as well as better serve students in + CTE programs. + \end{itemize} + +\end{description} + +The Action Subcommittee is currently reviewing the 2012/13 assessment work and +may propose to the SAC other ideas for implementation. + diff --git a/test-cases/oneSentencePerLine/pcc-program-review6-mod1.tex b/test-cases/oneSentencePerLine/pcc-program-review6-mod1.tex new file mode 100644 index 00000000..36d1dcd3 --- /dev/null +++ b/test-cases/oneSentencePerLine/pcc-program-review6-mod1.tex @@ -0,0 +1,221 @@ +% arara: pdflatex: {files: [MathSACpr2014]} +% !arara: indent: {overwrite: yes} +\chapter{Program/Discipline Overview} + +\epigraph{In two years, Portland Community College will be nationally known for + progress from developmental math to college level courses and completion.} +{Chris Chairsell, Vice President of Academic and Student Affairs; Portland + Community College Inservice, September 16, 2013} + +\section[Educational objectives]{What are the educational goals or objectives of this + program/discipline. + How do these compare with national or professional program/discipline trends or guidelines? + Have they changed since the last review, or are they expected to change in the next five years? + } + +As with any undergraduate or developmental education department, the primary goal of the faculty in the Math SAC can be summarized as follows: we hope to support students' life goals by imparting the skills and cognitive abilities necessary for continued success as they navigate their way through the education system and into the workforce. + +As evidenced in the remainder of this document, we have an active faculty who are continually trying innovative strategies to achieve this goal. +Many of these strategies have been targeted directly at increasing student success and completion, such as: \begin{itemize} \item Accelerated Math Placement (AMP) and other placement enhancement tools (see \cpageref{other:sec:amp}); \item study-skills focused classroom activities (see \cpageref{cur:sub:studyskills}); \item experimentation with interactive homework/learning systems as well as development of said systems targeted to our students (see \cpageref{other:sec:webwork} and \cpageref{sec3:subset:alekspilot}); \item establishment and dissemination of best practices for online accessibility (see \cpageref{needs:sec:access}). +\end{itemize} + +While each of these are worthy strategies, it has become increasingly apparent that something of greater scope needs to take place if we hope to see dramatic changes in the success and completion rates for students taking mathematics courses---especially those who initially place into developmental math courses. +The call for change nationwide in community colleges from access, to access and completion reinforces the Math SAC's awareness of the vital role we play in creating an environment of student success and completion. +We were pleased to hear Dr. +Chairsell call for the creation of a college-wide culture for math success, and we are very encouraged by the way in which this challenge has been embraced by departments such as student services. +We in the Math SAC also embrace Dr. +Chairsell's call for the creation of a college-wide culture for math success. +We are dedicated to making the necessary changes to our mathematics curriculum in order to maximize success and completion rates for our students. +By necessity, the most dramatic changes will need to take place in our developmental mathematics courses. +As we restructure, we are focused on integrating evidence-based best practices in order to achieve the highest rates of success and completion for our students. + +\subsection{Developmental Education (DE)} +Historically viewed as `remediation', developmental education has often been marginalized by higher education entities. +However, practices in developmental education have been given wide scientific attention, and best practices are supported with extensive research. + +The two largest organizations involved in developmental education research and professional development, the National Council of Developmental Education (NCDE) and the National Association of Developmental Education (NADE), define developmental education as \emph{a comprehensive process that focuses on the intellectual, social, and emotional growth and development of all students}. + +The number of reasons students place into pre-college courses are too numerous to list. +However, a large number of students entering at the DE mathematics level have the added burden of an intense anxiety that hinders their ability to be successful in a mathematics course. +In combination with the academic, social, economic, and psychological issues facing students in DE math courses, we must approach any changes with the whole student in mind. + +Over the last several years, there has been a growing sense that the traditional algebra content, as currently taught in our DE math courses, was not meeting the needs of many of our students. +The fact that in Fall 2013, over twenty-five SAC members joined the DE Math subcommittee formed specifically to take a deeper look at the developmental math sequence is a strong indicator of the interest and concerns we hold. + +\subsection{Science, Technology, Engineering, and Mathematics (STEM)} +Another emerging trend over the past five years has been a nationwide spotlight on STEM education and the dire need to increase the number of college students who ultimately obtain undergraduate degrees in STEM fields. +In fact, President Obama has formally designated increasing the number of undergraduate STEM majors by 1 million over the next decade as a Cross-Agency Priority (CAP) goal. +\footnote{\url{http://www.whitehouse.gov/blog/2012/12/18/one-decade-one-million-more-stem-graduates}} + +The CAP goal proposes to focus efforts in five promising areas of opportunity: \begin{itemize} \item identifying and implementing evidence-based practices to improve STEM teaching and to attract students to STEM courses (see \cpageref{webworkposter,reflect:page:stem}); \item providing more opportunities for students to engage in meaningful STEM activities through research experiences, especially in their first two years of college (see \cpageref{over:sec:DEfuture}); \item addressing the mathematics preparation gap that students face when they arrive at college, using evidence-based practices that generate improved results; \item providing educational opportunities and supports for women and historically underrepresented minorities; and \item identifying and supporting innovation in higher education. +\end{itemize} + +The Math SAC realizes that for many students entering at the developmental education level, math courses serve as a barrier for those who might otherwise choose to pursue careers in STEM; this is well documented in studies such as PCAST: Engage to Excel \cite{engagetoexcel}. +As we work to recreate our developmental math curriculum, we are mindful of the need to reform our courses in such a way that they no longer serve as a barrier to the success of our students, and so that they also serve as a gateway to STEM careers for students who may have steered away from math in the past. +Most of the goals stated as CAP \emph{areas of opportunity} include elements that can be addressed in our courses, and we hope to create courses that are in alignment with attainment of those goals. + +In doing this work, we have an eye not only on students who (eventually) pursue four-year STEM degrees, but we also have a focus on students enrolled in PCC's many CTE programs. +We are committed to creating courses that support success and completion for students enrolled in CTE programs. +Our courses must not only promote successful completion of the math course, but they must also impart skills that are specifically needed by the students in their CTE courses and ultimately in their chosen careers. + +\subsection{The future of DE and undergraduate math at PCC}\label{over:sec:DEfuture} +While we are still in conversation, some themes have begun to emerge. +Preliminary discussions have transpired that might lead us to revamp our developmental education courses with an emphasis on the following: \begin{itemize} \item evidence-based best practices; \item streamlining the developmental education sequence; \item creating developmental education sequences which support STEM education and, ideally, promotes STEM education; \item integrating content into our developmental math courses that will create a math literate populace (intelligent consumers of data and problem solvers); \item tracking our progress through data-analysis and assessment that ensures that completion measures of pass/fail rates do not mask a decrease in quality education. +\end{itemize} + +While our current focus is on DE and STEM, we are also mindful of the need to reexamine our undergraduate level courses. +The content and teaching practices we adopt for our developmental education courses need to be created with a clear understanding of the potential effects those changes will have on the students enrolled in our undergraduate level courses. +Additionally, we need to ensure that our commitment to using evidence-based best practices makes its way into the classroom for all of our courses, not just our developmental education courses. + +We are excited by this opportunity to restructure our courses in ways that better support student success and completion. +We realize that this change cannot be developed or implemented in isolation and we look forward to discussing our ideas for DE restructure at the program review meeting. +We also look forward to continuing collaborative conversations with all stakeholders including, but not limited to, administration, CTE faculty, advising, counseling, testing, student services, union representatives, and---ultimately---the students themselves. + +\subsubsection{Addendum}\label{over:subsub:nsfiuse} +In mid-December, 2013, members of the Math SAC were told that they were being given the opportunity to work with administration and members of a grant writing team to develop an NSF-IUSE grant proposal. +A team of four math faculty members was assembled for this work and over the next month they, along with the others working on the proposal, did a tremendous amount of research and met together at least weekly. +During this time we were working under the assumption that there were no restrictions of any kind on what we could propose in the grant. + +A three-part model was developed that involved the creation of a math-specific CG course, a totally redesigned pathway structure through DE math, and a dramatic ramping-up of the way in which the computer platform WeBWorK would be used by our students. +The new pathways proposed would require that STEM-based guided learning activities be written for five new courses. +Our inspiration for the guided learning approach was based in part on work being done for the New Mathways Project, which is a collaborative project between the Charles A. +Dana Center and the Texas Association of Community Colleges. +A diagram that illustrates the new pathway is shown in \cref{app:figure:pathways} (\vref{app:sec:pathways}). + +On January 16, the day before our participation in the project was slated to end, the math team working on the grant was informed that in fact there were restrictions associated with the grant. +Because of the restrictions, the grant developers had cut the amount of person hours we had proposed by a factor of ten. +The newly proposed amount of faculty release was not nearly sufficient to achieve the goals we had proposed. +After much brainstorming about ways in which we might overcome that deficit or scale back the project, it was agreed by everyone involved---math faculty, administrators, and grant writers---that there was not a good fit between our proposal and that specific grant opportunity. + +Not coincidentally, the Math SAC met on January \nth{17} in part to discuss the grant proposal. +At the end of that meeting the Math SAC, without a single no-vote, passed the following recommendations. + +\recommendation[Grants Office, PCC Cabinet]{The Math SAC endorses the draft outline of the NSF-IUSE grant + proposal, with the condition that the outline be fully supported with + appropriate funding and services as determined by the Math SAC, and we encourage + the Grants Office and PCC Cabinet to look into other funding sources.} + +\recommendation[Math SAC, CG SAC, Completion Investment Council]{Regardless of the final design of the DE mathematics pathways, + members of the Math SAC should continue to work with members of the CG SAC to + create a comprehensive CG course designed specifically to address the needs of + students registered in DE mathematics courses.} + +\section[Changes since the last program review]{Please summarize changes that have been made since the last + review.} +The mathematics department faculty is continually striving to improve our courses. +The recommendations from the 2003--2008 Program Review (PR) \cite{mathprogramreview2003} resulted in several changes as outlined in \vref{over:sec:changesresult}. +Some of the following changes that are mentioned in this section also appear at different sections of this document as referenced. +Most notably, our changes that are of a curricular nature are also addressed in \vref{chap:otherissues}. + +\subsection{Discontinue MTH 231 and MTH 232} +In Spring 2009 the Math SAC voted to discontinue offering MTH 231 and 232, our discrete mathematics courses. +The students taking these courses were mostly computer science students fulfilling requirements at PSU. +In order for the courses to transfer, the math department coordinated with the PCC and PSU computer science departments with respect to curriculum. +For various reasons it was mutually decided that the PCC computer science department should run the courses that are recognized statewide as CS 250 and 251. +\subsection{Formed the standing Math Learning Assessment Subcommittee + (Math LAS)} +The committee was formed to address the college's assessment of the Core Outcomes. +\Cref{chap:outcomes} of this document (\cpageref{chap:outcomes}) +outlines the results of this committee. +\subsection{Creation of MTH 84} +In Fall 2010 a pilot course was created to provide instruction in the use of the professional freeware publishing software \LaTeX. +While the emphasis of the course is creating professional mathematical documents, the skills learned can be used in a general context. +One online course was run each term and we received positive responses by students and faculty that took the course. +Students mention using the program in courses other than mathematics. +In May 2011 the Math SAC approved to make the one-credit course permanent (MTH 84) and we continue to run one online course every term---see \cpageref{other:sec:mth84} for more details. +\subsection{Creation of MTH 111H} +We approved the creation of a College Algebra honors course in Fall 2010. +A description can be found on \cpageref{cur:sub:111H}. +\subsection{Creation of faculty department co-chairs} +At the Cascade, Rock Creek and Sylvania campuses we offer between 100 to 150 class offerings per term, and thus we require a large part-time faculty pool to run these courses. +The formula used to measure the department chair load showed that each campus was either close to double if not more than double compared to the next highest faculty-chair load for any other discipline. +Starting in the Fall of 2010, the department chair positions at each of the mentioned campuses were split into co-chair positions. +Cascade, Rock Creek and Sylvania campuses each have two department co-chairs. +\subsection{Creation of SAC co-chairs option} +As the AY 2011/12 came to a close, the SAC voted to elect co-chairs for AY 2012/13, rather than a single SAC chair as had always been the custom. +This was repeated for AY 2013/14. +SAC by-laws will now be rewritten to allow the option for either a single SAC chair or SAC co-chairs. +The option for co-chairs may be most helpful in years surrounding Program Review, where SAC chair workload is higher than usual. +\subsection{Use of WeBWorK} +To further increase student accessibility and lower costs, Alex Jordan brought to our attention the freeware program, WeBWorK, partially supported by National Science Foundation grants. +The software is an online homework/testing system that can provide \emph{immediate} feedback to the student. +Spearheaded by Alex Jordan, faculty have been working on creating databases that fit our current curriculum. + +We have been using WeBWorK since Spring 2009 and it is currently being used by several faculty in courses offered at PCC. +The advantages to the \emph{student} are that it is free and it is accessible to students with disabilities. +The advantages to \emph{faculty} are that we can adapt it to our own curriculum and can be used for other purposes besides coursework. +Ideas being proposed would allow for students to use it for preparation before taking placement exams. +We still are in the beginning phases as such a proposal would need to overcome technical difficulties. +Winter 2014 was the first term that we were able to run the program using PCC servers which allowed us to control the platform of this program. +Up to this point we had relied upon University of Oregon servers, which limited the capabilities of this program. +Further details are given on \cpageref{other:sec:webwork}. +\subsection{Social justice workgroup} +Four math faculty attended the conference ``Creating Balance in an Unjust World'' in San Francisco in Winter 2012 and were inspired to form an ongoing collaboration of faculty (including faculty from other disciplines) to create assignments and projects that have a social justice theme. +These faculty members share their assignments with others and encourage all math faculty to join them when they meet; see \cpageref{cur:sub:socialJustic} for more details. +\subsection{Credit hour change to MTH 243} +Students brought to our attention that our MTH 243 course was not transferring cleanly to some institutions. +To address this issue, MTH 243 changed from four to five credits effective Fall 2012. +An explanation for the change can be found in \vref{cur:sec:other}. +\subsection{Offering ALC math courses at Southeast} +To better serve students at Southeast, in Summer 2012, Southeast began offering self-paced basic math and introductory algebra courses (ALC Math) that were previously only offered at Sylvania. +\Vref{cur:sec:other} +contains further explanation of these courses. + +\section[Changes resulting from the last program review]{Were any of the changes + made as a result of the last review? + If so, please describe the rationale and result. + }\label{over:sec:changesresult} + +In the 2003--2008 PR and the corresponding Administrative Response (AR), a large number of recommendations were given from the Math SAC and the Administration. +This section will look at changes that have been made due to those recommendations and some recommendations that are still being addressed. + +\subsection{Incorporation of MTH 20 from DE} +One of the recommendations from the 2003--2008 PR (\cite{mathprogramreview2003}, page 30) was to transfer MTH 20 from the Developmental Education department to the Mathematics department. +That change has taken effect starting Fall 2013. +The change helped to align Sylvania with the rest of the campuses as to how this course was viewed. +Due to lack of resources (at other campuses) MTH 20 was, for all practical purposes, under the jurisdiction of the Math department. +Due to this change instructors teaching ALC math courses asked to also be incorporated into the Math department, housing all math courses under one legislative body. +The move was completed as of January 2013 (see \vref{app:sec:alc}). + +\subsection{Alternative methods to accelerate completion} +The Administrative Response (AR) gave a list of recommendations (page 3) relating to alternative methods of moving students through the math sequence and accelerated math sequences. +In response to this recommendation, MTH 07/MTH 08 Accelerated Math Review (see \vref{other:sec:amp}) were created by the Math SAC. +Now that these classes are available we are hoping to offer more sections. +This will require more advertising when students are placed into a math class. +Additionally, since the ALC math classes have been moved into the Math SAC, the math faculty have become more aware of these courses. +The ALC classes were once only available at Sylvania, but now Southeast has incorporated the sequence and other campuses are looking into it. + +\subsection{Assessment and course outcomes} +Page 2 of the AR asks the Math SAC to look at assessment more and take our Course Outcomes to the next level. +Please see \vref{chap:outcomes} (of this document) for details. +We have made major improvements on this front and have a standing assessment committee and action committee. +Some of our faculty members have roles in the college-wide assessment strategies and the Learning Assessment Council. + +\subsection{Removal of MTH 91 and MTH 92} +The success rates for MTH 91 and 92 and additionally MTH 61, 62, and 63 were mentioned on page 2 of the AR. +After looking at the success rates of MTH 91 and 92, the Math SAC no longer offers these sections. +MTH 61, 62, and 63 are still being offered, but the Math SAC continues to work on Developmental Math and we currently have two committees looking at alternative Math Pathways. +Our hope is that a revised math curriculum could improve success and completion rates for students who usually take MTH 61, 62, 63. + +\subsection{Study skills website} +Page 28 of the PR (\cite{mathprogramreview2003}) recommended that an orientation to `Studying at college' be part of the general orientation process. +Since the college has yet to make changes in this area, Jessica Bernards created study skills videos and activities that are currently being used by math faculty in Developmental Math Classes; further details are discussed on \cpageref{cur:sub:studyskills}. + +\subsection{Enrollment issues with MTH 105} +A recommendation in the PR (\cite{mathprogramreview2003} page 31) wanted department chairs to look at MTH 105's low enrollment. +Since then MTH 111 B and C have been merged into a single MTH 111 class and the enrollment numbers in MTH 105 have increased. +Additionally two committees are currently looking at math pathways from the pre-college classes that might also increase 105 numbers. +This change also led to the adoption of a new MTH 111 textbook. +Normally changing a book wouldn't merit mention in a PR, but this book has a different philosophy and has therefore added additional changes to the college level math sequence. + +\subsection{Distance learning standing committee} +A large number of recommendations from the last PR (\cite{mathprogramreview2003} pages 32--34) are related to Distance Learning. +We currently have a DL standing committee that looks into these matters. +See \vref{other:sec:distancelearning} (of this document) for a list of changes and concerns that the Distance Learning Standing Committee is currently working on. + +\subsection{Academic interventions} +Finally, the last PR (\cite{mathprogramreview2003}, pages 30--31) made suggestions related to faculty contact with students outside the classroom and in the learning center. +The math faculty has continued to support the learning center over the last five years. +At Cascade Campus the math faculty have been working with retention specialists by creating academic interventions for students of concern. +This program shows promise and the specialists now have an office in the math department and three staff members. + diff --git a/test-cases/oneSentencePerLine/pcc-program-review6-mod2.tex b/test-cases/oneSentencePerLine/pcc-program-review6-mod2.tex new file mode 100644 index 00000000..bec9eb19 --- /dev/null +++ b/test-cases/oneSentencePerLine/pcc-program-review6-mod2.tex @@ -0,0 +1,236 @@ +% arara: pdflatex: {files: [MathSACpr2014]} +% !arara: indent: {overwrite: yes} +\chapter{Program/Discipline Overview} + +\epigraph{In two years, Portland Community College will be nationally known for + progress from developmental math to college level courses and completion.} +{Chris Chairsell, Vice President of Academic and Student Affairs; Portland + Community College Inservice, September 16, 2013} + +\section[Educational objectives]{What are the educational goals or objectives of this + program/discipline. + How do these compare with national or professional program/discipline trends or guidelines? + Have they changed since the last review, or are they expected to change in the next five years? + } + +As with any undergraduate or developmental education department, the primary goal of the faculty in the Math SAC can be summarized as follows: we hope to support students' life goals by imparting the skills and cognitive abilities necessary for continued success as they navigate their way through the education system and into the workforce. + +As evidenced in the remainder of this document, we have an active faculty who are continually trying innovative strategies to achieve this goal. +Many of these strategies have been targeted directly at increasing student success and completion, such as: +\begin{itemize} + \item Accelerated Math Placement (AMP) and other placement enhancement tools (see \cpageref{other:sec:amp}); + \item study-skills focused classroom activities (see \cpageref{cur:sub:studyskills}); + \item experimentation with interactive homework/learning systems as well as development of said systems targeted to our students (see \cpageref{other:sec:webwork} and \cpageref{sec3:subset:alekspilot}); + \item establishment and dissemination of best practices for online accessibility (see \cpageref{needs:sec:access}). +\end{itemize} + +While each of these are worthy strategies, it has become increasingly apparent that something of greater scope needs to take place if we hope to see dramatic changes in the success and completion rates for students taking mathematics courses---especially those who initially place into developmental math courses. +The call for change nationwide in community colleges from access, to access and completion reinforces the Math SAC's awareness of the vital role we play in creating an environment of student success and completion. +We were pleased to hear Dr. +Chairsell call for the creation of a college-wide culture for math success, and we are very encouraged by the way in which this challenge has been embraced by departments such as student services. +We in the Math SAC also embrace Dr. +Chairsell's call for the creation of a college-wide culture for math success. +We are dedicated to making the necessary changes to our mathematics curriculum in order to maximize success and completion rates for our students. +By necessity, the most dramatic changes will need to take place in our developmental mathematics courses. +As we restructure, we are focused on integrating evidence-based best practices in order to achieve the highest rates of success and completion for our students. + +\subsection{Developmental Education (DE)} +Historically viewed as `remediation', developmental education has often been marginalized by higher education entities. +However, practices in developmental education have been given wide scientific attention, and best practices are supported with extensive research. + +The two largest organizations involved in developmental education research and professional development, the National Council of Developmental Education (NCDE) and the National Association of Developmental Education (NADE), define developmental education as \emph{a comprehensive process that focuses on the intellectual, social, and emotional growth and development of all students}. + +The number of reasons students place into pre-college courses are too numerous to list. +However, a large number of students entering at the DE mathematics level have the added burden of an intense anxiety that hinders their ability to be successful in a mathematics course. +In combination with the academic, social, economic, and psychological issues facing students in DE math courses, we must approach any changes with the whole student in mind. + +Over the last several years, there has been a growing sense that the traditional algebra content, as currently taught in our DE math courses, was not meeting the needs of many of our students. +The fact that in Fall 2013, over twenty-five SAC members joined the DE Math subcommittee formed specifically to take a deeper look at the developmental math sequence is a strong indicator of the interest and concerns we hold. + +\subsection{Science, Technology, Engineering, and Mathematics (STEM)} +Another emerging trend over the past five years has been a nationwide spotlight on STEM education and the dire need to increase the number of college students who ultimately obtain undergraduate degrees in STEM fields. +In fact, President Obama has formally designated increasing the number of undergraduate STEM majors by 1 million over the next decade as a Cross-Agency Priority (CAP) goal. +\footnote{\url{http://www.whitehouse.gov/blog/2012/12/18/one-decade-one-million-more-stem-graduates}} + +The CAP goal proposes to focus efforts in five promising areas of opportunity: +\begin{itemize} + \item identifying and implementing evidence-based practices to improve STEM teaching and to attract students to STEM courses (see \cpageref{webworkposter,reflect:page:stem}); + \item providing more opportunities for students to engage in meaningful STEM activities through research experiences, especially in their first two years of college (see \cpageref{over:sec:DEfuture}); + \item addressing the mathematics preparation gap that students face when they arrive at college, using evidence-based practices that generate improved results; + \item providing educational opportunities and supports for women and historically underrepresented minorities; and + \item identifying and supporting innovation in higher education. +\end{itemize} + +The Math SAC realizes that for many students entering at the developmental education level, math courses serve as a barrier for those who might otherwise choose to pursue careers in STEM; this is well documented in studies such as PCAST: Engage to Excel \cite{engagetoexcel}. +As we work to recreate our developmental math curriculum, we are mindful of the need to reform our courses in such a way that they no longer serve as a barrier to the success of our students, and so that they also serve as a gateway to STEM careers for students who may have steered away from math in the past. +Most of the goals stated as CAP \emph{areas of opportunity} include elements that can be addressed in our courses, and we hope to create courses that are in alignment with attainment of those goals. + +In doing this work, we have an eye not only on students who (eventually) pursue four-year STEM degrees, but we also have a focus on students enrolled in PCC's many CTE programs. +We are committed to creating courses that support success and completion for students enrolled in CTE programs. +Our courses must not only promote successful completion of the math course, but they must also impart skills that are specifically needed by the students in their CTE courses and ultimately in their chosen careers. + +\subsection{The future of DE and undergraduate math at PCC}\label{over:sec:DEfuture} +While we are still in conversation, some themes have begun to emerge. +Preliminary discussions have transpired that might lead us to revamp our developmental education courses with an emphasis on the following: +\begin{itemize} + \item evidence-based best practices; + \item streamlining the developmental education sequence; + \item creating developmental education sequences which support STEM education and, ideally, promotes STEM education; + \item integrating content into our developmental math courses that will create a math literate populace (intelligent consumers of data and problem solvers); + \item tracking our progress through data-analysis and assessment that ensures that completion measures of pass/fail rates do not mask a decrease in quality education. +\end{itemize} + +While our current focus is on DE and STEM, we are also mindful of the need to reexamine our undergraduate level courses. +The content and teaching practices we adopt for our developmental education courses need to be created with a clear understanding of the potential effects those changes will have on the students enrolled in our undergraduate level courses. +Additionally, we need to ensure that our commitment to using evidence-based best practices makes its way into the classroom for all of our courses, not just our developmental education courses. + +We are excited by this opportunity to restructure our courses in ways that better support student success and completion. +We realize that this change cannot be developed or implemented in isolation and we look forward to discussing our ideas for DE restructure at the program review meeting. +We also look forward to continuing collaborative conversations with all stakeholders including, but not limited to, administration, CTE faculty, advising, counseling, testing, student services, union representatives, and---ultimately---the students themselves. + +\subsubsection{Addendum}\label{over:subsub:nsfiuse} +In mid-December, 2013, members of the Math SAC were told that they were being given the opportunity to work with administration and members of a grant writing team to develop an NSF-IUSE grant proposal. +A team of four math faculty members was assembled for this work and over the next month they, along with the others working on the proposal, did a tremendous amount of research and met together at least weekly. +During this time we were working under the assumption that there were no restrictions of any kind on what we could propose in the grant. + +A three-part model was developed that involved the creation of a math-specific CG course, a totally redesigned pathway structure through DE math, and a dramatic ramping-up of the way in which the computer platform WeBWorK would be used by our students. +The new pathways proposed would require that STEM-based guided learning activities be written for five new courses. +Our inspiration for the guided learning approach was based in part on work being done for the New Mathways Project, which is a collaborative project between the Charles A. +Dana Center and the Texas Association of Community Colleges. +A diagram that illustrates the new pathway is shown in \cref{app:figure:pathways} (\vref{app:sec:pathways}). + +On January 16, the day before our participation in the project was slated to end, the math team working on the grant was informed that in fact there were restrictions associated with the grant. +Because of the restrictions, the grant developers had cut the amount of person hours we had proposed by a factor of ten. +The newly proposed amount of faculty release was not nearly sufficient to achieve the goals we had proposed. +After much brainstorming about ways in which we might overcome that deficit or scale back the project, it was agreed by everyone involved---math faculty, administrators, and grant writers---that there was not a good fit between our proposal and that specific grant opportunity. + +Not coincidentally, the Math SAC met on January \nth{17} in part to discuss the grant proposal. +At the end of that meeting the Math SAC, without a single no-vote, passed the following recommendations. + +\recommendation[Grants Office, PCC Cabinet]{The Math SAC endorses the draft outline of the NSF-IUSE grant + proposal, with the condition that the outline be fully supported with + appropriate funding and services as determined by the Math SAC, and we encourage + the Grants Office and PCC Cabinet to look into other funding sources.} + +\recommendation[Math SAC, CG SAC, Completion Investment Council]{Regardless of the final design of the DE mathematics pathways, + members of the Math SAC should continue to work with members of the CG SAC to + create a comprehensive CG course designed specifically to address the needs of + students registered in DE mathematics courses.} + +\section[Changes since the last program review]{Please summarize changes that have been made since the last + review.} +The mathematics department faculty is continually striving to improve our courses. +The recommendations from the 2003--2008 Program Review (PR) \cite{mathprogramreview2003} resulted in several changes as outlined in \vref{over:sec:changesresult}. +Some of the following changes that are mentioned in this section also appear at different sections of this document as referenced. +Most notably, our changes that are of a curricular nature are also addressed in \vref{chap:otherissues}. + +\subsection{Discontinue MTH 231 and MTH 232} +In Spring 2009 the Math SAC voted to discontinue offering MTH 231 and 232, our discrete mathematics courses. +The students taking these courses were mostly computer science students fulfilling requirements at PSU. +In order for the courses to transfer, the math department coordinated with the PCC and PSU computer science departments with respect to curriculum. +For various reasons it was mutually decided that the PCC computer science department should run the courses that are recognized statewide as CS 250 and 251. +\subsection{Formed the standing Math Learning Assessment Subcommittee + (Math LAS)} +The committee was formed to address the college's assessment of the Core Outcomes. +\Cref{chap:outcomes} of this document (\cpageref{chap:outcomes}) outlines the results of this committee. +\subsection{Creation of MTH 84} +In Fall 2010 a pilot course was created to provide instruction in the use of the professional freeware publishing software \LaTeX. +While the emphasis of the course is creating professional mathematical documents, the skills learned can be used in a general context. +One online course was run each term and we received positive responses by students and faculty that took the course. +Students mention using the program in courses other than mathematics. +In May 2011 the Math SAC approved to make the one-credit course permanent (MTH 84) and we continue to run one online course every term---see \cpageref{other:sec:mth84} for more details. +\subsection{Creation of MTH 111H} +We approved the creation of a College Algebra honors course in Fall 2010. +A description can be found on \cpageref{cur:sub:111H}. +\subsection{Creation of faculty department co-chairs} +At the Cascade, Rock Creek and Sylvania campuses we offer between 100 to 150 class offerings per term, and thus we require a large part-time faculty pool to run these courses. +The formula used to measure the department chair load showed that each campus was either close to double if not more than double compared to the next highest faculty-chair load for any other discipline. +Starting in the Fall of 2010, the department chair positions at each of the mentioned campuses were split into co-chair positions. +Cascade, Rock Creek and Sylvania campuses each have two department co-chairs. +\subsection{Creation of SAC co-chairs option} +As the AY 2011/12 came to a close, the SAC voted to elect co-chairs for AY 2012/13, rather than a single SAC chair as had always been the custom. +This was repeated for AY 2013/14. +SAC by-laws will now be rewritten to allow the option for either a single SAC chair or SAC co-chairs. +The option for co-chairs may be most helpful in years surrounding Program Review, where SAC chair workload is higher than usual. +\subsection{Use of WeBWorK} +To further increase student accessibility and lower costs, Alex Jordan brought to our attention the freeware program, WeBWorK, partially supported by National Science Foundation grants. +The software is an online homework/testing system that can provide \emph{immediate} feedback to the student. +Spearheaded by Alex Jordan, faculty have been working on creating databases that fit our current curriculum. + +We have been using WeBWorK since Spring 2009 and it is currently being used by several faculty in courses offered at PCC. +The advantages to the \emph{student} are that it is free and it is accessible to students with disabilities. +The advantages to \emph{faculty} are that we can adapt it to our own curriculum and can be used for other purposes besides coursework. +Ideas being proposed would allow for students to use it for preparation before taking placement exams. +We still are in the beginning phases as such a proposal would need to overcome technical difficulties. +Winter 2014 was the first term that we were able to run the program using PCC servers which allowed us to control the platform of this program. +Up to this point we had relied upon University of Oregon servers, which limited the capabilities of this program. +Further details are given on \cpageref{other:sec:webwork}. +\subsection{Social justice workgroup} +Four math faculty attended the conference ``Creating Balance in an Unjust World'' in San Francisco in Winter 2012 and were inspired to form an ongoing collaboration of faculty (including faculty from other disciplines) to create assignments and projects that have a social justice theme. +These faculty members share their assignments with others and encourage all math faculty to join them when they meet; see \cpageref{cur:sub:socialJustic} for more details. +\subsection{Credit hour change to MTH 243} +Students brought to our attention that our MTH 243 course was not transferring cleanly to some institutions. +To address this issue, MTH 243 changed from four to five credits effective Fall 2012. +An explanation for the change can be found in \vref{cur:sec:other}. +\subsection{Offering ALC math courses at Southeast} +To better serve students at Southeast, in Summer 2012, Southeast began offering self-paced basic math and introductory algebra courses (ALC Math) that were previously only offered at Sylvania. +\Vref{cur:sec:other} +contains further explanation of these courses. + +\section[Changes resulting from the last program review]{Were any of the changes + made as a result of the last review? + If so, please describe the rationale and result.}\label{over:sec:changesresult} + +In the 2003--2008 PR and the corresponding Administrative Response (AR), a large number of recommendations were given from the Math SAC and the Administration. +This section will look at changes that have been made due to those recommendations and some recommendations that are still being addressed. + +\subsection{Incorporation of MTH 20 from DE} +One of the recommendations from the 2003--2008 PR (\cite{mathprogramreview2003}, page 30) was to transfer MTH 20 from the Developmental Education department to the Mathematics department. +That change has taken effect starting Fall 2013. +The change helped to align Sylvania with the rest of the campuses as to how this course was viewed. +Due to lack of resources (at other campuses) MTH 20 was, for all practical purposes, under the jurisdiction of the Math department. +Due to this change instructors teaching ALC math courses asked to also be incorporated into the Math department, housing all math courses under one legislative body. +The move was completed as of January 2013 (see \vref{app:sec:alc}). + +\subsection{Alternative methods to accelerate completion} +The Administrative Response (AR) gave a list of recommendations (page 3) relating to alternative methods of moving students through the math sequence and accelerated math sequences. +In response to this recommendation, MTH 07/MTH 08 Accelerated Math Review (see \vref{other:sec:amp}) were created by the Math SAC. +Now that these classes are available we are hoping to offer more sections. +This will require more advertising when students are placed into a math class. +Additionally, since the ALC math classes have been moved into the Math SAC, the math faculty have become more aware of these courses. +The ALC classes were once only available at Sylvania, but now Southeast has incorporated the sequence and other campuses are looking into it. + +\subsection{Assessment and course outcomes} +Page 2 of the AR asks the Math SAC to look at assessment more and take our Course Outcomes to the next level. +Please see \vref{chap:outcomes} (of this document) for details. +We have made major improvements on this front and have a standing assessment committee and action committee. +Some of our faculty members have roles in the college-wide assessment strategies and the Learning Assessment Council. + +\subsection{Removal of MTH 91 and MTH 92} +The success rates for MTH 91 and 92 and additionally MTH 61, 62, and 63 were mentioned on page 2 of the AR. +After looking at the success rates of MTH 91 and 92, the Math SAC no longer offers these sections. +MTH 61, 62, and 63 are still being offered, but the Math SAC continues to work on Developmental Math and we currently have two committees looking at alternative Math Pathways. +Our hope is that a revised math curriculum could improve success and completion rates for students who usually take MTH 61, 62, 63. + +\subsection{Study skills website} +Page 28 of the PR (\cite{mathprogramreview2003}) recommended that an orientation to `Studying at college' be part of the general orientation process. +Since the college has yet to make changes in this area, Jessica Bernards created study skills videos and activities that are currently being used by math faculty in Developmental Math Classes; further details are discussed on \cpageref{cur:sub:studyskills}. + +\subsection{Enrollment issues with MTH 105} +A recommendation in the PR (\cite{mathprogramreview2003} page 31) wanted department chairs to look at MTH 105's low enrollment. +Since then MTH 111 B and C have been merged into a single MTH 111 class and the enrollment numbers in MTH 105 have increased. +Additionally two committees are currently looking at math pathways from the pre-college classes that might also increase 105 numbers. +This change also led to the adoption of a new MTH 111 textbook. +Normally changing a book wouldn't merit mention in a PR, but this book has a different philosophy and has therefore added additional changes to the college level math sequence. + +\subsection{Distance learning standing committee} +A large number of recommendations from the last PR (\cite{mathprogramreview2003} pages 32--34) are related to Distance Learning. +We currently have a DL standing committee that looks into these matters. +See \vref{other:sec:distancelearning} (of this document) for a list of changes and concerns that the Distance Learning Standing Committee is currently working on. + +\subsection{Academic interventions} +Finally, the last PR (\cite{mathprogramreview2003}, pages 30--31) made suggestions related to faculty contact with students outside the classroom and in the learning center. +The math faculty has continued to support the learning center over the last five years. +At Cascade Campus the math faculty have been working with retention specialists by creating academic interventions for students of concern. +This program shows promise and the specialists now have an office in the math department and three staff members. + diff --git a/test-cases/oneSentencePerLine/pcc-program-review6.tex b/test-cases/oneSentencePerLine/pcc-program-review6.tex new file mode 100644 index 00000000..449cad4b --- /dev/null +++ b/test-cases/oneSentencePerLine/pcc-program-review6.tex @@ -0,0 +1,373 @@ +% arara: pdflatex: {files: [MathSACpr2014]} +% !arara: indent: {overwrite: yes} +\chapter{Program/Discipline Overview} + +\epigraph{In two years, Portland Community College will be nationally known for +progress from developmental math to college level courses and completion.} +{Chris Chairsell, Vice President of Academic and Student Affairs; Portland +Community College Inservice, September 16, 2013} + +\section[Educational objectives]{What are the educational goals or objectives of this + program/discipline. How do these compare with national or professional + program/discipline trends or guidelines? Have they changed since the last +review, or are they expected to change in the next five years? } + +As with any undergraduate or developmental education department, the primary +goal of the faculty in the Math SAC can be summarized as follows: we hope +to support students' life goals by imparting the skills and cognitive +abilities necessary for continued success as they navigate their way through the +education system and into the workforce. + +As evidenced in the remainder of this document, we have an active faculty who +are continually trying innovative strategies to achieve this goal. Many of +these strategies have been targeted directly at increasing student success and +completion, such as: +\begin{itemize} + \item Accelerated Math Placement (AMP) and other placement enhancement tools + (see \cpageref{other:sec:amp}); + \item study-skills focused classroom activities (see \cpageref{cur:sub:studyskills}); + \item experimentation with interactive homework/learning systems as well as + development of said systems targeted to our students (see + \cpageref{other:sec:webwork} and \cpageref{sec3:subset:alekspilot}); + \item establishment and dissemination of best practices for + online accessibility (see \cpageref{needs:sec:access}). +\end{itemize} + +While each of these are worthy strategies, it has become increasingly apparent +that something of greater scope needs to take place if we hope to see dramatic +changes in the success and completion rates for students taking mathematics +courses---especially those who initially place into developmental math courses. +The call for change nationwide in community colleges from access, to access and +completion reinforces the Math SAC's awareness of the vital role we play in +creating an environment of student success and completion. We were pleased to +hear Dr. Chairsell call for the creation of a college-wide culture for math +success, and we are very encouraged by the way in which this challenge has been +embraced by departments such as student services. We in the Math SAC also embrace +Dr. Chairsell's call for the creation of a college-wide culture for math +success. We are dedicated to making the necessary changes to our mathematics +curriculum in order to maximize success and completion rates for our students. +By necessity, the most dramatic changes will need to take place in our +developmental mathematics courses. As we restructure, we are focused on +integrating evidence-based best practices in order to achieve the highest +rates of success and completion for our students. + +\subsection{Developmental Education (DE)} +Historically viewed as `remediation', developmental education has often +been marginalized by higher education entities. However, practices in developmental +education have been given wide scientific attention, and best practices are supported with +extensive research. + +The two largest organizations involved in developmental education research and +professional development, the National Council of Developmental Education (NCDE) and +the National Association of Developmental Education (NADE), define developmental +education as \emph{a comprehensive process that focuses on the intellectual, +social, and emotional growth and development of all students}. + +The number of reasons students place into pre-college courses are too numerous +to list. However, a large number of students entering at the DE mathematics +level have the added burden of an intense anxiety that hinders their ability to +be successful in a mathematics course. In combination with the academic, +social, economic, and psychological issues facing students in DE math courses, +we must approach any changes with the whole student in mind. + +Over the last several years, there has been a growing sense that the traditional +algebra content, as currently taught in our DE math courses, was not meeting the +needs of many of our students. The fact that in Fall 2013, over twenty-five SAC +members joined the DE Math subcommittee formed specifically to take a deeper +look at the developmental math sequence is a strong indicator of the interest and +concerns we hold. + +\subsection{Science, Technology, Engineering, and Mathematics (STEM)} +Another emerging trend over the past five years has been a nationwide spotlight +on STEM education and the dire need to increase the +number of college students who ultimately obtain undergraduate degrees in STEM fields. In +fact, President Obama has formally designated increasing the number of +undergraduate STEM majors by 1 million over the next decade as a Cross-Agency +Priority (CAP) +goal.\footnote{\url{http://www.whitehouse.gov/blog/2012/12/18/one-decade-one-million-more-stem-graduates}} + +The CAP goal proposes to focus efforts in five promising areas of opportunity: +\begin{itemize} + \item identifying and implementing evidence-based practices to improve STEM teaching + and to attract students to STEM courses (see + \cpageref{webworkposter,reflect:page:stem}); + \item providing more opportunities for students to engage in meaningful STEM + activities through research experiences, especially in their first two years of + college (see + \cpageref{over:sec:DEfuture}); + \item addressing the mathematics preparation gap that students face when they arrive + at college, using evidence-based practices that generate improved results; + \item providing educational opportunities and supports for women and historically + underrepresented minorities; and + \item identifying and supporting innovation in higher + education. +\end{itemize} + +The Math SAC realizes that for many students entering at the developmental +education level, math courses serve as a barrier for those who might otherwise +choose to pursue careers in STEM; this is well documented in studies such as +PCAST: Engage to Excel \cite{engagetoexcel}. As we work to recreate our +developmental math curriculum, we are mindful of the need to reform our courses +in such a way that they no longer serve as a barrier to the success of our +students, and so that they also serve as a gateway to +STEM careers for students who may have steered away from math in the past. Most +of the goals stated as CAP \emph{areas of opportunity} include elements that +can be addressed in our courses, and we hope to create courses that are in alignment with +attainment of those goals. + +In doing this work, we have an eye not only on students who (eventually) +pursue four-year STEM degrees, but we also have a focus on students enrolled in +PCC's many CTE programs. We are committed to creating courses that support +success and completion for students enrolled in CTE programs. Our courses must +not only promote successful completion of the math course, but they must also +impart skills that are specifically needed by the students in their CTE +courses and ultimately in their chosen careers. + +\subsection{The future of DE and undergraduate math at PCC}\label{over:sec:DEfuture} +While we are still in conversation, some themes have begun to emerge. +Preliminary discussions have transpired that might lead us to +revamp our developmental education courses with an emphasis on the following: +\begin{itemize} + \item evidence-based best practices; + \item streamlining the developmental education sequence; + \item creating developmental education sequences which support STEM education and, + ideally, promotes STEM education; + \item integrating content into our developmental math + courses that will create a math literate populace (intelligent consumers of data + and problem solvers); + \item tracking our progress through data-analysis and assessment that ensures that + completion measures of pass/fail rates do not mask a decrease in quality + education. +\end{itemize} + +While our current focus is on DE and STEM, we are also mindful of the need to +reexamine our undergraduate level courses. The content and teaching practices we +adopt for our developmental education courses need to be created with a clear +understanding of the potential effects those changes will have on the students +enrolled in our undergraduate level courses. Additionally, we need to ensure +that our commitment to using evidence-based best practices makes its way into +the classroom for all of our courses, not just our developmental education +courses. + +We are excited by this opportunity to restructure our courses in ways that +better support student success and completion. We realize that this change +cannot be developed or implemented in isolation and we look forward to +discussing our ideas for DE restructure at the program review meeting. We also look +forward to continuing collaborative conversations with all +stakeholders including, but not limited to, administration, CTE faculty, +advising, counseling, testing, student services, union representatives, and---ultimately---the students themselves. + +\subsubsection{Addendum}\label{over:subsub:nsfiuse} +In mid-December, 2013, members of the Math SAC were told that they were being +given the opportunity to work with administration and members of a grant writing +team to develop an NSF-IUSE grant proposal. A team of four math faculty members +was assembled for this work and over the next month they, along with the others +working on the proposal, did a tremendous amount of research and met together at +least weekly. During this time we were working under the assumption that there +were no restrictions of any kind on what we could propose in the grant. + +A three-part model was developed that involved the creation of a math-specific +CG course, a totally redesigned pathway structure through DE math, and a +dramatic ramping-up of the way in which the computer platform WeBWorK would be +used by our students. The new pathways proposed would require that STEM-based +guided learning activities be written for five new courses. Our inspiration for +the guided learning approach was based in part on work being done for the New +Mathways Project, which is a collaborative project between the Charles A. Dana +Center and the Texas Association of Community Colleges. A diagram that +illustrates the new pathway is shown in \cref{app:figure:pathways} +(\vref{app:sec:pathways}). + +On January 16, the day before our participation in the project was slated to +end, the math team working on the grant was informed that in fact there were +restrictions associated with the grant. Because of the restrictions, the grant +developers had cut the amount of person hours we had proposed by a factor of +ten. The newly proposed amount of faculty release was not nearly sufficient to +achieve the goals we had proposed. After much brainstorming about ways in which we +might overcome that deficit or scale back the project, it +was agreed by everyone involved---math faculty, administrators, and grant +writers---that there was not a good fit between our proposal and that specific +grant opportunity. + +Not coincidentally, the Math SAC met on January \nth{17} in part to discuss the grant +proposal. At the end of that meeting the Math SAC, without a single no-vote, +passed the following recommendations. + +\recommendation[Grants Office, PCC Cabinet]{The Math SAC endorses the draft outline of the NSF-IUSE grant + proposal, with the condition that the outline be fully supported with + appropriate funding and services as determined by the Math SAC, and we encourage +the Grants Office and PCC Cabinet to look into other funding sources.} + +\recommendation[Math SAC, CG SAC, Completion Investment Council]{Regardless of the final design of the DE mathematics pathways, + members of the Math SAC should continue to work with members of the CG SAC to + create a comprehensive CG course designed specifically to address the needs of +students registered in DE mathematics courses.} + +\section[Changes since the last program review]{Please summarize changes that have been made since the last +review.} +The mathematics department faculty is continually striving to improve our +courses. The recommendations from the 2003--2008 Program Review (PR) \cite{mathprogramreview2003} +resulted in several changes as outlined in \vref{over:sec:changesresult}. Some of the following +changes that are mentioned in this section also appear at different sections of this document +as referenced. Most notably, our changes that are of a curricular nature are also addressed in \vref{chap:otherissues}. + +\subsection{Discontinue MTH 231 and MTH 232} In Spring 2009 +the Math SAC voted to discontinue offering MTH +231 and 232, our discrete mathematics courses. The students taking these +courses were mostly computer science students fulfilling requirements at +PSU. In order for the courses to transfer, the math department coordinated +with the PCC and PSU computer science departments with respect to +curriculum. For various reasons it was mutually decided that the PCC +computer science department should run the courses that are recognized +statewide as CS 250 and 251. +\subsection{Formed the standing Math Learning Assessment Subcommittee +(Math LAS)} +The committee was formed to address the college's assessment of the Core +Outcomes. \Cref{chap:outcomes} of this document (\cpageref{chap:outcomes}) +outlines the results of this committee. +\subsection{Creation of MTH 84} In Fall 2010 a pilot course was created to provide +instruction in the use of the professional freeware publishing software +\LaTeX. While the emphasis of the course is creating professional +mathematical documents, the skills learned can be used in a general context. +One online course was run each term and we received positive responses by +students and faculty that took the course. Students mention using the +program in courses other than mathematics. In May 2011 the Math SAC +approved to make the one-credit course permanent (MTH 84) and we continue to run one +online course every term---see \cpageref{other:sec:mth84} for more details. +\subsection{Creation of MTH 111H} We approved the creation of a College Algebra honors +course in Fall 2010. A description can be found on \cpageref{cur:sub:111H}. +\subsection{Creation of faculty department co-chairs} At the Cascade, Rock Creek and Sylvania campuses we +offer between 100 to 150 class offerings per term, and +thus we require a large part-time faculty pool to run these courses. The +formula used to measure the department chair load showed that each campus +was either close to double if not more than double compared to the next +highest faculty-chair load for any other discipline. Starting in the Fall +of 2010, the department chair positions at each of the mentioned campuses +were split into co-chair positions. Cascade, Rock Creek and Sylvania +campuses each have two department co-chairs. +\subsection{Creation of SAC co-chairs option} As the AY 2011/12 came to a close, the SAC voted to elect +co-chairs for AY 2012/13, rather than a single SAC chair as had always been the custom. +This was repeated for AY 2013/14. SAC by-laws will now be rewritten to allow the option for either +a single SAC chair or SAC co-chairs. The option for co-chairs may be most helpful in years surrounding +Program Review, where SAC chair workload is higher than usual. +\subsection{Use of WeBWorK} To further increase student accessibility and lower costs, +Alex Jordan brought to our attention the freeware program, +WeBWorK, partially supported by National Science Foundation grants. The +software is an online homework/testing +system that can provide \emph{immediate} feedback to the student. Spearheaded by Alex +Jordan, faculty have been working on creating databases that fit our current +curriculum. + +We have been using WeBWorK since Spring 2009 and it is currently being used by several faculty in courses +offered at PCC. The advantages to the \emph{student} are that it is free and it is +accessible to students with disabilities. The advantages to \emph{faculty} are that +we can adapt it to our own curriculum and can be used for other purposes +besides coursework. Ideas being proposed would allow for students to +use it for preparation before taking placement exams. We still are in the +beginning phases as such a proposal would need to overcome technical +difficulties. Winter 2014 was the first term that we were able to +run the program using PCC servers which allowed us to control the platform +of this program. Up to this point we had relied upon University of Oregon +servers, which limited the capabilities of this program. Further details +are given on \cpageref{other:sec:webwork}. +\subsection{Social justice workgroup} Four math faculty attended the conference +``Creating Balance in an Unjust World'' in San Francisco in Winter 2012 +and were inspired to form an ongoing collaboration of faculty (including faculty from other disciplines) to create +assignments and projects that have a social justice theme. These faculty +members share their assignments with others and encourage all math faculty +to join them when they meet; see \cpageref{cur:sub:socialJustic} for +more details. +\subsection{Credit hour change to MTH 243} Students brought to our attention that our +MTH 243 course was not transferring cleanly to some institutions. To +address this issue, MTH 243 changed from four to five credits effective Fall +2012. An explanation for the change can be found in \vref{cur:sec:other}. +\subsection{Offering ALC math courses at Southeast} To better serve students at Southeast, in Summer 2012, Southeast began offering +self-paced basic math and introductory algebra courses (ALC Math) that were previously only offered at +Sylvania. \Vref{cur:sec:other} +contains further explanation of these courses. + +\section[Changes resulting from the last program review]{Were any of the changes + made as a result of the last review? If so, + please describe the rationale and result.}\label{over:sec:changesresult} + +In the 2003--2008 PR and the corresponding Administrative +Response (AR), a large number of recommendations were given from the Math SAC and +the Administration. This section will look at changes that have been made due +to those recommendations and some recommendations that are still being +addressed. + +\subsection{Incorporation of MTH 20 from DE} +One of the recommendations from the 2003--2008 PR (\cite{mathprogramreview2003}, page 30) was to transfer MTH +20 from the Developmental Education department to the Mathematics department. +That change has taken effect starting Fall 2013. The change helped to align +Sylvania with the rest of the campuses as to how this course was viewed. Due +to lack of resources (at other campuses) MTH 20 was, for all practical purposes, +under the jurisdiction of the Math department. Due to this change instructors +teaching ALC math courses asked to also be incorporated into the Math +department, housing all math courses under one legislative body. The move was +completed as of January 2013 (see \vref{app:sec:alc}). + +\subsection{Alternative methods to accelerate completion} +The Administrative Response (AR) gave a list of recommendations (page 3) relating to alternative methods +of moving students through the math sequence and accelerated math sequences. In +response to this recommendation, MTH 07/MTH 08 Accelerated Math Review (see +\vref{other:sec:amp}) were created by the Math SAC. +Now that these classes are available we are hoping to offer more sections. This +will require more advertising when students are placed into a math class. +Additionally, since the ALC math classes have been moved into the Math SAC, the math +faculty have become more aware of these courses. The ALC classes were once only +available at Sylvania, but now Southeast has incorporated the sequence +and other campuses are looking into it. + +\subsection{Assessment and course outcomes} +Page 2 of the AR asks the Math SAC to look at assessment more and take our +Course Outcomes to the next level. Please see \vref{chap:outcomes} (of this +document) for +details. We have made major improvements on this front and have a standing +assessment committee and action committee. Some of our faculty members have +roles in the college-wide assessment strategies and the Learning Assessment Council. + +\subsection{Removal of MTH 91 and MTH 92} +The success rates for MTH 91 and 92 and additionally MTH 61, 62, and 63 were +mentioned on page 2 of the AR. After looking at the success rates of MTH 91 and +92, the Math SAC no longer offers these sections. MTH 61, 62, and 63 are still +being offered, but the Math SAC continues to work on Developmental Math and we +currently have two committees looking at alternative Math Pathways. +Our hope is that a revised math curriculum could improve success and completion +rates for students who usually take MTH 61, 62, 63. + +\subsection{Study skills website} +Page 28 of the PR (\cite{mathprogramreview2003}) recommended that an orientation to `Studying at college' +be part of the general orientation process. Since the college has yet to make +changes in this area, Jessica Bernards created study skills videos and activities +that are currently being used by math faculty in Developmental Math Classes; +further details are discussed on \cpageref{cur:sub:studyskills}. + +\subsection{Enrollment issues with MTH 105} +A recommendation in the PR (\cite{mathprogramreview2003} page 31) wanted +department chairs to look at MTH +105's low enrollment. Since then MTH 111 B and C have been merged into a single +MTH 111 class and the enrollment numbers in MTH 105 have increased. +Additionally two committees are +currently looking at math pathways from the pre-college classes that might also +increase 105 numbers. This change also led to the adoption of a new MTH 111 +textbook. Normally changing a book wouldn't merit mention in a PR, but this book +has a different philosophy and has therefore added additional changes to the +college level math sequence. + +\subsection{Distance learning standing committee} +A large number of recommendations from the last PR (\cite{mathprogramreview2003} +pages 32--34) are related to +Distance Learning. We currently have a DL standing committee that looks into +these matters. See \vref{other:sec:distancelearning} (of this document) for a +list of changes and concerns +that the Distance Learning Standing Committee is currently working on. + +\subsection{Academic interventions} +Finally, the last PR (\cite{mathprogramreview2003}, pages 30--31) made +suggestions related to faculty contact with +students outside the classroom and in the learning center. The math faculty has +continued to support the learning center over the last five years. At Cascade +Campus the math faculty have been working with retention specialists by creating +academic interventions for students of concern. This program shows promise and +the specialists now have an office in the math department and three staff members. + diff --git a/test-cases/oneSentencePerLine/sentences-across-blank-lines.tex b/test-cases/oneSentencePerLine/sentences-across-blank-lines.tex new file mode 100644 index 00000000..723d5ce7 --- /dev/null +++ b/test-cases/oneSentencePerLine/sentences-across-blank-lines.tex @@ -0,0 +1,5 @@ +This is the +third sentence + +and it continues here +sentence! diff --git a/test-cases/oneSentencePerLine/sentences-across-blank-linesmod0.tex b/test-cases/oneSentencePerLine/sentences-across-blank-linesmod0.tex new file mode 100644 index 00000000..579e3df7 --- /dev/null +++ b/test-cases/oneSentencePerLine/sentences-across-blank-linesmod0.tex @@ -0,0 +1,3 @@ +This is the third sentence + +and it continues here sentence! diff --git a/test-cases/oneSentencePerLine/sentences-across-blank-linesmod1.tex b/test-cases/oneSentencePerLine/sentences-across-blank-linesmod1.tex new file mode 100644 index 00000000..641ffdb4 --- /dev/null +++ b/test-cases/oneSentencePerLine/sentences-across-blank-linesmod1.tex @@ -0,0 +1 @@ +This is the third sentence and it continues here sentence! diff --git a/test-cases/oneSentencePerLine/sentences-across-blocks.tex b/test-cases/oneSentencePerLine/sentences-across-blocks.tex new file mode 100644 index 00000000..69c9db87 --- /dev/null +++ b/test-cases/oneSentencePerLine/sentences-across-blocks.tex @@ -0,0 +1,11 @@ +This sentence stretches +\[ + x^2 + \] +across lines. + +As does +\begin{tabular}{cc} + 1 & 2\\ +3&4\end{tabular} +this one. diff --git a/test-cases/oneSentencePerLine/sentences-across-blocksmod0.tex b/test-cases/oneSentencePerLine/sentences-across-blocksmod0.tex new file mode 100644 index 00000000..05042e67 --- /dev/null +++ b/test-cases/oneSentencePerLine/sentences-across-blocksmod0.tex @@ -0,0 +1,3 @@ +This sentence stretches \[ x^2 \] across lines. + +As does \begin{tabular}{cc} 1 & 2\\ 3&4\end{tabular} this one. diff --git a/test-cases/oneSentencePerLine/sentences-start-with-lower-case.yaml b/test-cases/oneSentencePerLine/sentences-start-with-lower-case.yaml new file mode 100644 index 00000000..52f5711c --- /dev/null +++ b/test-cases/oneSentencePerLine/sentences-start-with-lower-case.yaml @@ -0,0 +1,4 @@ +modifyLineBreaks: + oneSentencePerLine: + sentencesBeginWith: + a-z: 1 diff --git a/test-cases/oneSentencePerLine/six-sentences-mult-blank.tex b/test-cases/oneSentencePerLine/six-sentences-mult-blank.tex new file mode 100644 index 00000000..0a29e229 --- /dev/null +++ b/test-cases/oneSentencePerLine/six-sentences-mult-blank.tex @@ -0,0 +1,27 @@ +This is the first +sentence. This is the second sentence. This is the +third sentence. + + + +This is the fourth +sentence! + + + +This is the fifth +sentence. This is the +sixth sentence. + + +This is the seventh +sentence! This is the +eighth sentence. + +This is the ninth +sentence? This is the +tenth sentence. +\par +This is +the eleventh +sentence. diff --git a/test-cases/oneSentencePerLine/six-sentences-mult-blankmod0.tex b/test-cases/oneSentencePerLine/six-sentences-mult-blankmod0.tex new file mode 100644 index 00000000..478a988f --- /dev/null +++ b/test-cases/oneSentencePerLine/six-sentences-mult-blankmod0.tex @@ -0,0 +1,16 @@ +This is the first sentence. +This is the second sentence. +This is the third sentence. + +This is the fourth sentence! + +This is the fifth sentence. +This is the sixth sentence. + +This is the seventh sentence! +This is the eighth sentence. + +This is the ninth sentence? +This is the tenth sentence. +\par +This is the eleventh sentence. diff --git a/test-cases/oneSentencePerLine/six-sentences-mult-blankmod1.tex b/test-cases/oneSentencePerLine/six-sentences-mult-blankmod1.tex new file mode 100644 index 00000000..cef1d773 --- /dev/null +++ b/test-cases/oneSentencePerLine/six-sentences-mult-blankmod1.tex @@ -0,0 +1,21 @@ +This is the first sentence. +This is the second sentence. +This is the third sentence. + + + +This is the fourth sentence! + + + +This is the fifth sentence. +This is the sixth sentence. + + +This is the seventh sentence! +This is the eighth sentence. + +This is the ninth sentence? +This is the tenth sentence. +\par +This is the eleventh sentence. diff --git a/test-cases/oneSentencePerLine/six-sentences-mult-blankmod2.tex b/test-cases/oneSentencePerLine/six-sentences-mult-blankmod2.tex new file mode 100644 index 00000000..d718c57f --- /dev/null +++ b/test-cases/oneSentencePerLine/six-sentences-mult-blankmod2.tex @@ -0,0 +1,20 @@ +This is the first sentence. +This is the second sentence. +This is the third sentence. + +This is the fourth +sentence! + +This is the fifth +sentence. +This is the sixth sentence. + +This is the seventh +sentence! +This is the eighth sentence. + +This is the ninth +sentence? +This is the tenth sentence. +\par +This is the eleventh sentence. diff --git a/test-cases/oneSentencePerLine/six-sentences-mult-blankmod3.tex b/test-cases/oneSentencePerLine/six-sentences-mult-blankmod3.tex new file mode 100644 index 00000000..d1b0dfff --- /dev/null +++ b/test-cases/oneSentencePerLine/six-sentences-mult-blankmod3.tex @@ -0,0 +1,20 @@ +This is the first sentence. +This is the second sentence. +This is the third sentence. + +This is the fourth +sentence! + +This is the fifth +sentence. This is the +sixth sentence. + +This is the seventh +sentence! +This is the eighth sentence. + +This is the ninth +sentence? +This is the tenth sentence. +\par +This is the eleventh sentence. diff --git a/test-cases/oneSentencePerLine/six-sentences-mult-blankmod4.tex b/test-cases/oneSentencePerLine/six-sentences-mult-blankmod4.tex new file mode 100644 index 00000000..8cebe336 --- /dev/null +++ b/test-cases/oneSentencePerLine/six-sentences-mult-blankmod4.tex @@ -0,0 +1,20 @@ +This is the first sentence. +This is the second sentence. +This is the third sentence. + +This is the fourth +sentence! + +This is the fifth +sentence. +This is the sixth sentence. + +This is the seventh +sentence! This is the +eighth sentence. + +This is the ninth +sentence? +This is the tenth sentence. +\par +This is the eleventh sentence. diff --git a/test-cases/oneSentencePerLine/six-sentences-mult-blankmod5.tex b/test-cases/oneSentencePerLine/six-sentences-mult-blankmod5.tex new file mode 100644 index 00000000..4fa69705 --- /dev/null +++ b/test-cases/oneSentencePerLine/six-sentences-mult-blankmod5.tex @@ -0,0 +1,20 @@ +This is the first sentence. +This is the second sentence. +This is the third sentence. + +This is the fourth +sentence! + +This is the fifth +sentence. +This is the sixth sentence. + +This is the seventh +sentence! +This is the eighth sentence. + +This is the ninth +sentence? This is the +tenth sentence. +\par +This is the eleventh sentence. diff --git a/test-cases/oneSentencePerLine/six-sentences-mult-blankmod6.tex b/test-cases/oneSentencePerLine/six-sentences-mult-blankmod6.tex new file mode 100644 index 00000000..b9245f0b --- /dev/null +++ b/test-cases/oneSentencePerLine/six-sentences-mult-blankmod6.tex @@ -0,0 +1,27 @@ +This is the first +sentence. +This is the second sentence. +This is the +third sentence. + +This is the fourth +sentence! + +This is the fifth +sentence. +This is the +sixth sentence. + +This is the seventh +sentence! +This is the +eighth sentence. + +This is the ninth +sentence? +This is the +tenth sentence. +\par +This is +the eleventh +sentence. diff --git a/test-cases/oneSentencePerLine/six-sentences.tex b/test-cases/oneSentencePerLine/six-sentences.tex new file mode 100644 index 00000000..f639964b --- /dev/null +++ b/test-cases/oneSentencePerLine/six-sentences.tex @@ -0,0 +1,7 @@ +This is the first +sentence. This is the second sentence. This is the +third sentence. + +This is the fourth +sentence! This is the fifth sentence? This is the +sixth sentence. diff --git a/test-cases/oneSentencePerLine/six-sentencesmod1.tex b/test-cases/oneSentencePerLine/six-sentencesmod1.tex new file mode 100644 index 00000000..8bf0e6df --- /dev/null +++ b/test-cases/oneSentencePerLine/six-sentencesmod1.tex @@ -0,0 +1,7 @@ +This is the first sentence. +This is the second sentence. +This is the third sentence. + +This is the fourth sentence! +This is the fifth sentence? +This is the sixth sentence. diff --git a/test-cases/oneSentencePerLine/six-sentencesmod2.tex b/test-cases/oneSentencePerLine/six-sentencesmod2.tex new file mode 100644 index 00000000..8bf0e6df --- /dev/null +++ b/test-cases/oneSentencePerLine/six-sentencesmod2.tex @@ -0,0 +1,7 @@ +This is the first sentence. +This is the second sentence. +This is the third sentence. + +This is the fourth sentence! +This is the fifth sentence? +This is the sixth sentence. diff --git a/test-cases/oneSentencePerLine/six-sentencesmod3.tex b/test-cases/oneSentencePerLine/six-sentencesmod3.tex new file mode 100644 index 00000000..6ddf9735 --- /dev/null +++ b/test-cases/oneSentencePerLine/six-sentencesmod3.tex @@ -0,0 +1,6 @@ +This is the first sentence. +This is the second sentence. +This is the third sentence. + +This is the fourth sentence! This is the fifth sentence? +This is the sixth sentence. diff --git a/test-cases/oneSentencePerLine/six-sentencesmod4.tex b/test-cases/oneSentencePerLine/six-sentencesmod4.tex new file mode 100644 index 00000000..c7632313 --- /dev/null +++ b/test-cases/oneSentencePerLine/six-sentencesmod4.tex @@ -0,0 +1,6 @@ +This is the first sentence. This is the second sentence. This is the third sentence. + +This is the fourth sentence! +This is the fifth sentence? +This is the +sixth sentence. diff --git a/test-cases/oneSentencePerLine/six-sentencesmod5.tex b/test-cases/oneSentencePerLine/six-sentencesmod5.tex new file mode 100644 index 00000000..3beec699 --- /dev/null +++ b/test-cases/oneSentencePerLine/six-sentencesmod5.tex @@ -0,0 +1,6 @@ +This is the first sentence. +This is the second sentence. +This is the third sentence. + +This is the fourth sentence! +This is the fifth sentence? This is the sixth sentence. diff --git a/test-cases/oneSentencePerLine/texbook-snippet.tex b/test-cases/oneSentencePerLine/texbook-snippet.tex new file mode 100644 index 00000000..c540ef38 --- /dev/null +++ b/test-cases/oneSentencePerLine/texbook-snippet.tex @@ -0,0 +1,20 @@ +% https://tex.stackexchange.com/questions/325505/best-practices-for-source-file-line-lengths/325511 +This manual is intended for people who have never used \TeX\ before, as +well as for experienced \TeX\ hackers. In other words, it's supposed to +be a panacea that satisfies everybody, at the risk of satisfying nobody. +Everything you need to know about \TeX\ is explained +here somewhere, and so are a lot of things that most users don't care about. +If you are preparing a simple manuscript, you won't need to +learn much about \TeX\ at all; on the other hand, some +things that go into the printing of technical books are inherently +difficult, and if you wish to achieve more complex effects you +will want to penetrate some of \TeX's darker corners. In order +to make it possible for many types of users to read this manual +effectively, a special sign is used to designate material that is +for wizards only: When the symbol +$$\vbox{\hbox{\dbend}\vskip 11pt}$$ +appears at the beginning of a paragraph, it warns of a ``^{dangerous bend}'' +in the train of thought; don't read the paragraph unless you need to. +Brave and experienced drivers at the controls of \TeX\ will gradually enter +more and more of these hazardous areas, but for most applications the +details won't matter. diff --git a/test-cases/oneSentencePerLine/texbook-snippetmod1.tex b/test-cases/oneSentencePerLine/texbook-snippetmod1.tex new file mode 100644 index 00000000..fa63ae98 --- /dev/null +++ b/test-cases/oneSentencePerLine/texbook-snippetmod1.tex @@ -0,0 +1,7 @@ +% https://tex.stackexchange.com/questions/325505/best-practices-for-source-file-line-lengths/325511 +This manual is intended for people who have never used \TeX\ before, as well as for experienced \TeX\ hackers. +In other words, it's supposed to be a panacea that satisfies everybody, at the risk of satisfying nobody. +Everything you need to know about \TeX\ is explained here somewhere, and so are a lot of things that most users don't care about. +If you are preparing a simple manuscript, you won't need to learn much about \TeX\ at all; on the other hand, some things that go into the printing of technical books are inherently difficult, and if you wish to achieve more complex effects you will want to penetrate some of \TeX's darker corners. +In order to make it possible for many types of users to read this manual effectively, a special sign is used to designate material that is for wizards only: When the symbol $$\vbox{\hbox{\dbend}\vskip 11pt}$$ appears at the beginning of a paragraph, it warns of a ``^{dangerous bend}'' in the train of thought; don't read the paragraph unless you need to. +Brave and experienced drivers at the controls of \TeX\ will gradually enter more and more of these hazardous areas, but for most applications the details won't matter. diff --git a/test-cases/oneSentencePerLine/texbook-snippetmod2.tex b/test-cases/oneSentencePerLine/texbook-snippetmod2.tex new file mode 100644 index 00000000..f27a5cc4 --- /dev/null +++ b/test-cases/oneSentencePerLine/texbook-snippetmod2.tex @@ -0,0 +1,20 @@ +% https://tex.stackexchange.com/questions/325505/best-practices-for-source-file-line-lengths/325511 +This manual is intended for people who have never used \TeX\ before, +as well as for experienced \TeX\ hackers. +In other words, +it's supposed to be a panacea that satisfies everybody, +at the risk of satisfying nobody. +Everything you need to know about \TeX\ is explained here somewhere, +and so are a lot of things that most users don't care about. +If you are preparing a simple manuscript, +you won't need to learn much about \TeX\ at all; +on the other hand, +some things that go into the printing of technical books are inherently difficult, +and if you wish to achieve more complex effects you will want to penetrate some of \TeX's darker corners. +In order to make it possible for many types of users to read this manual effectively, +a special sign is used to designate material that is for wizards only: +When the symbol $$\vbox{\hbox{\dbend}\vskip 11pt}$$ appears at the beginning of a paragraph, +it warns of a ``^{dangerous bend}'' in the train of thought; +don't read the paragraph unless you need to. +Brave and experienced drivers at the controls of \TeX\ will gradually enter more and more of these hazardous areas, +but for most applications the details won't matter. diff --git a/test-cases/oneSentencePerLine/texbook-snippetmod3.tex b/test-cases/oneSentencePerLine/texbook-snippetmod3.tex new file mode 100644 index 00000000..0710aa78 --- /dev/null +++ b/test-cases/oneSentencePerLine/texbook-snippetmod3.tex @@ -0,0 +1,8 @@ +% https://tex.stackexchange.com/questions/325505/best-practices-for-source-file-line-lengths/325511 +This manual is intended for people who have never used \TeX\ before, as +well as for experienced \TeX\ hackers. +In other words, it's supposed to be a panacea that satisfies everybody, at the risk of satisfying nobody. +Everything you need to know about \TeX\ is explained here somewhere, and so are a lot of things that most users don't care about. +If you are preparing a simple manuscript, you won't need to learn much about \TeX\ at all; on the other hand, some things that go into the printing of technical books are inherently difficult, and if you wish to achieve more complex effects you will want to penetrate some of \TeX's darker corners. +In order to make it possible for many types of users to read this manual effectively, a special sign is used to designate material that is for wizards only: When the symbol $$\vbox{\hbox{\dbend}\vskip 11pt}$$ appears at the beginning of a paragraph, it warns of a ``^{dangerous bend}'' in the train of thought; don't read the paragraph unless you need to. +Brave and experienced drivers at the controls of \TeX\ will gradually enter more and more of these hazardous areas, but for most applications the details won't matter. diff --git a/test-cases/oneSentencePerLine/three-sentences-trailing-comments.tex b/test-cases/oneSentencePerLine/three-sentences-trailing-comments.tex new file mode 100644 index 00000000..d78cee6f --- /dev/null +++ b/test-cases/oneSentencePerLine/three-sentences-trailing-comments.tex @@ -0,0 +1,7 @@ +%This is the first +%sentence. This is the second sentence. This is the +%third sentence. + +This is the fourth +sentence! This is the fifth sentence? This is the +sixth sentence. diff --git a/test-cases/oneSentencePerLine/three-sentences-trailing-commentsmod1.tex b/test-cases/oneSentencePerLine/three-sentences-trailing-commentsmod1.tex new file mode 100644 index 00000000..69e67eb5 --- /dev/null +++ b/test-cases/oneSentencePerLine/three-sentences-trailing-commentsmod1.tex @@ -0,0 +1,7 @@ +%This is the first +%sentence. This is the second sentence. This is the +%third sentence. + +This is the fourth sentence! +This is the fifth sentence? +This is the sixth sentence. diff --git a/test-cases/oneSentencePerLine/three-sentences-trailing-commentsmod2.tex b/test-cases/oneSentencePerLine/three-sentences-trailing-commentsmod2.tex new file mode 100644 index 00000000..69e67eb5 --- /dev/null +++ b/test-cases/oneSentencePerLine/three-sentences-trailing-commentsmod2.tex @@ -0,0 +1,7 @@ +%This is the first +%sentence. This is the second sentence. This is the +%third sentence. + +This is the fourth sentence! +This is the fifth sentence? +This is the sixth sentence. diff --git a/test-cases/oneSentencePerLine/trailing-comments.tex b/test-cases/oneSentencePerLine/trailing-comments.tex new file mode 100644 index 00000000..e75ac6ee --- /dev/null +++ b/test-cases/oneSentencePerLine/trailing-comments.tex @@ -0,0 +1,11 @@ +This is %1st comment +the first% 2nd comment +sentence.% 3rd comment + +This is the second sentence. % ?! 4th comment +This is the % 5th comment +third sentence. + +This is the fourth +sentence! This is the fifth sentence? This is the +sixth sentence. diff --git a/test-cases/oneSentencePerLine/trailing-commentsmod0.tex b/test-cases/oneSentencePerLine/trailing-commentsmod0.tex new file mode 100644 index 00000000..f662f60d --- /dev/null +++ b/test-cases/oneSentencePerLine/trailing-commentsmod0.tex @@ -0,0 +1,11 @@ +This is the first sentence. +%1st comment% 2nd comment% 3rd comment + +This is the second sentence. +% ?! 4th comment +This is the third sentence. +% 5th comment + +This is the fourth sentence! +This is the fifth sentence? +This is the sixth sentence. diff --git a/test-cases/oneSentencePerLine/trailing-commentsmod1.tex b/test-cases/oneSentencePerLine/trailing-commentsmod1.tex new file mode 100644 index 00000000..7adbf1f3 --- /dev/null +++ b/test-cases/oneSentencePerLine/trailing-commentsmod1.tex @@ -0,0 +1,16 @@ +This is +the first +sentence. +%1st comment% 2nd comment% 3rd comment + +This is the second sentence. +% ?! 4th comment +This is the +third sentence. +% 5th comment + +This is the fourth +sentence! +This is the fifth sentence? +This is the +sixth sentence. diff --git a/test-cases/oneSentencePerLine/two-sentences.tex b/test-cases/oneSentencePerLine/two-sentences.tex new file mode 100644 index 00000000..0cb37697 --- /dev/null +++ b/test-cases/oneSentencePerLine/two-sentences.tex @@ -0,0 +1,5 @@ +This is the +first sentence. + +This is the second +sentence! diff --git a/test-cases/oneSentencePerLine/two-sentencesmod0.tex b/test-cases/oneSentencePerLine/two-sentencesmod0.tex new file mode 100644 index 00000000..7956bf3a --- /dev/null +++ b/test-cases/oneSentencePerLine/two-sentencesmod0.tex @@ -0,0 +1,5 @@ +This is the +first sentence. + +This is the second +sentence! diff --git a/test-cases/oneSentencePerLine/two-sentencesmod1.tex b/test-cases/oneSentencePerLine/two-sentencesmod1.tex new file mode 100644 index 00000000..81d87c84 --- /dev/null +++ b/test-cases/oneSentencePerLine/two-sentencesmod1.tex @@ -0,0 +1,3 @@ +This is the first sentence. + +This is the second sentence! diff --git a/test-cases/oneSentencePerLine/verbatim-test.tex b/test-cases/oneSentencePerLine/verbatim-test.tex new file mode 100644 index 00000000..8f7250ef --- /dev/null +++ b/test-cases/oneSentencePerLine/verbatim-test.tex @@ -0,0 +1,14 @@ +This is the fourth +sentence! This is the fifth sentence? This is the +sixth sentence, and runs across +\begin{verbatim} + This is the fourth + sentence! This is the fifth sentence? This is the + sixth sentence. +\end{verbatim} +a verbatim environment; +and beyond! + +This is the fourth +sentence! This is the fifth sentence? This is the +sixth sentence. diff --git a/test-cases/oneSentencePerLine/verbatim-testmod0.tex b/test-cases/oneSentencePerLine/verbatim-testmod0.tex new file mode 100644 index 00000000..8d57bbea --- /dev/null +++ b/test-cases/oneSentencePerLine/verbatim-testmod0.tex @@ -0,0 +1,11 @@ +This is the fourth sentence! +This is the fifth sentence? +This is the sixth sentence, and runs across \begin{verbatim} + This is the fourth + sentence! This is the fifth sentence? This is the + sixth sentence. +\end{verbatim} a verbatim environment; and beyond! + +This is the fourth sentence! +This is the fifth sentence? +This is the sixth sentence. diff --git a/test-cases/oneSentencePerLine/webwork-guide.tex b/test-cases/oneSentencePerLine/webwork-guide.tex new file mode 100644 index 00000000..8ab1cdd6 --- /dev/null +++ b/test-cases/oneSentencePerLine/webwork-guide.tex @@ -0,0 +1,467 @@ +% https://raw.githubusercontent.com/Alex-Jordan/WeBWorKUserGuide/master/WeBWorKUserGuide.tex +% arara: pdflatex +% arara: pdflatex +\documentclass[12pt]{article} + +\usepackage[charter]{mathdesign} % changes font + +\usepackage[margin=2cm]{geometry} +\usepackage{keystroke,dsfont,verbatim} +\usepackage[super]{nth} +\usepackage[colorlinks=true, linkcolor=blue]{hyperref} + +\newcommand{\menu}[1]{\textbf{#1}} +\newcommand{\WW}{WeBWorK} +\newcommand{\HSE}{\menu{Hmwk Sets Editor}} +\newcommand{\FM}{\menu{File Manager}} + +\setlength{\parindent}{0mm} +\setcounter{secnumdepth}{0} + +\title{\WW\ User Guide for PCC Instructors} +\author{Alex Jordan\\\href{mailto:alex.jordan@pcc.edu}{alex.jordan@pcc.edu}} + +\begin{document} + +\maketitle + +This document is meant to serve two purposes. For PCC faculty who are already familiar with \WW, this is meant to be a reference. From the table of contents you may hyperlink to any topic. For PCC faculty who are new to \WW, the document can be used linearly as you set up your course. + +\footnotesize +\setcounter{tocdepth}{2} +\tableofcontents + +\setlength{\parskip}{10pt} + +\newpage +\normalsize + +\section{Overview} + +\WW\ is accessed through a web browser. Its primary purpose is for your students to submit mathematical answers to homework problems. It has several other uses including timed exams, placement testing, data-gathering, and general collection of (not necessarily mathematical) student responses. + +You will have access to several libraries of problems, each problem of which is coded in the form of a plain text file. A \emph{homework set} is a list of problems from these libraries together with a due date and certain other options. When a homework set has been created, you assign it to your students, or subsets of your students. \WW\ keeps track of all student input and their scores. Note that a \emph{homework set} does not need to literally be a homework set. It could be a review set, an exam, a survey, reading material, etc. + +Your role\footnote{More complicated roles are possible.} is to: +\begin{enumerate} +\item Add your students to the course and choose some initial configuration settings. +\item Create the problem sets. I recommend getting this all laid out before the term starts. It is a one-day investment that will reduce your workload during the term. You will have complete flexibility to change anything later. For future versions of the same course, this process is very fast; you can copy an old setup and just change dates. +\item Respond to student emails for help. \WW\ will allow students to email you rather effortlessly for help. Since the volume of email that this creates can get large, I recommend setting up an email filter to separate any incoming message with [WWfeedback] in the subject header. When you have time and are in the right mindset to respond to student emails, you can go through this pile more efficiently. +\item Put out occasional fires. Maybe a student forgets their password. Maybe you want to grant an extension to an assignment. Maybe there is a code issue with a problem that you have assigned (in which case you may need to call for help.) +\item Gather the grades from \WW\ and import them into your grade book. +\end{enumerate} + +If you are brand new to \WW\, then I suggest progressing in a straight line through this guide. You will know when it is OK to skip something. If you have more than one section of a course, then focus on one section first. You will be able to quickly copy your setup once the first section is in good shape. If you are not new to \WW\, then consider this document to be a reference guide. + +\section{Logging On and Passwords} + +Unless you have a special case,\footnote{Some special courses may have a different structure to their address.} your course is located at (using all lowercase letters): +\begin{center} +\href{http://webwork.pcc.edu/webwork2/}{\texttt{http://webwork.pcc.edu/webwork2/aaabbb-ccccc-lastname}}\\ +or at\\ + \href{http://webwork.pcc.edu/webwork2/}{\texttt{http://webwork.pcc.edu/webwork2/aaabbb-astname-term}} +\end{center} where \texttt{aaa} is your subject code (mth, cs, etc.), \texttt{bbb} is your course number (060, 111, etc.), \texttt{xxxxx} is your CRN, \texttt{lastname} is your last name, and \texttt{term} is something like \texttt{f15}. You can ask to remove your last name from the CRN-specific address, but having it there can make it easy to find your own courses from among the list at \url{webwork.pcc.edu}. Make a bookmark with this link at your work station---you will need to come here often. For your students, you should make a link in MyPCC under the \menu{Links} section. (Don't make them have to directly type the awkward web address.) It's also possible that your course is listed at \href{http://webwork.pcc.edu/webwork2/}{http://webwork.pcc.edu/webwork2/}, but it may be hidden. + +In most cases, everyone's login should be their complete PCC email prefix, using \emph{all lowercase} letters. If your email is \texttt{jane.doe15@pcc.edu}, your login should be \texttt{jane.doe15}. The default password should be your G-number, using \emph{a capital G}. It might be your old password if you have used \WW\ before. If you cannot log on, contact \href{mailto:alex.jordan@pcc.edu}{Alex Jordan} (SY) or Carl Yao (SE), each of whom has administrative access to your account. Everyone (especially instructors and TAs) should change their password the first time that they log in. This is done using the \menu{Password/Email} item under \WW's main menu. + + +\section{Initial Setup} +When you first receive your \WW\ course, there are a few items to initialize. On the home screen when you log in, you will see \menu{Course Info} off to the right. You should \menu{[edit]} this, providing all students with some basic course information. You may use \href{http://en.wikipedia.org/wiki/HTML_element}{html tags} to improve the look of this section or link to other web resources, but that's not necessary. (This is all stored in your course's \FM\ as \verb=course_info.txt= if you would like to access that file directly.) + +%You can also include a text file (with html if you like) to display information at the login screen. This file should be stored in your \FM\ as \verb=login_info.txt=. The default gives helpful information to students about how to log in. + +Next, there are some options you might want to tend to in the \menu{Course Configuration} menu. Browse through all five tabs in the \menu{Course Configuration} menu. All options should be set to something reasonable by default. If you understand what an option does, feel free to change it. Of course if you do not understand an option, leave it alone or feel free to ask about it. The most common items you may want to change settings for are: + +\subsection{Enable Conditional Release} + +If you would like to make it possible to conditionally release homework assignments, you can enable this option. For example, this can be used to make it so that Assignment \#2 is not available until a student has say a 90\% on Assignment \#1, etc. + +\subsection{Course Achievements} + +\WW\ has a feature called Course Achievements. This is a way to award achievement points (separate from regular homework points), badges, levels, and special items to students to make the whole experience more like a game. For many students, this `gamification' of homework is motivational. If you like, enable Course Achievements in the \menu{Course Configuration} menu. Once you do this, your navigation panel will have an \menu{Achievements Editor} in the instructor tools. Also, all users will have an \menu{Achievements} menu to monitor their achievements. To make use of this feature, you need to import achievements and assign them to your students. This is discussed in more detail in the \hyperref[gamification]{Gamification} section. + +\subsection{Enabling MathView} + +This is a palette tools that may make it easier for students to enter complicated expressions. If it is enabled, there will be an icon next to each answer blank. Clicking this icon will open an applet window that allows students to construct an expression with radicals, fractions, and more using a palette similar to MathType (but with few complications). MathView is enabled by default. If a student has a MathView window open, then they can see the ``pretty-print'' version of their answer as they type it. For example, as they type \texttt{(x+1)/x}, they will see this sequence appear character by character: $$(\qquad(x\qquad(x+\qquad(x+1\qquad(x+1)\qquad\frac{x+1}{}\qquad\frac{x+1}{x}$$ + +\subsection{Reduced Scoring for Late Work} + +Your assignments will each have a due date/time. If you like, you may allow students to work beyond the due date/time for reduced credit. If you plan to use this for any homework sets +\begin{itemize} +\item Enable Reduced Scoring +\item Set the Length of Reduced Scoring Period in minutes +\item Set the Value of work done in Reduced Scoring Period +\end{itemize} +Later when you create an assignment, you will \emph{still} need to enable reduced scoring for that particular assignment within the \HSE, since it is possible to have some assignments use reduced scoring and other assignments not use it. You can \hyperref[reducedcredit]{read about this} in the \hyperref[makeset]{section on creating homework sets}. + +\emph{Warning:} If you use this feature, there is currently an unfortunate arrangement. The displayed due date will be the date and time beyond which students cannot submit \emph{any} more answers. The reduced credit period begins \emph{prior} to this. \WW\ \emph{does} explain this to students alongside the due date, but this arrangement is potentially confusing. + +\subsection{Show Me Another Button} + +If you enable this feature, then you will have the ability to make it so that a student can see a re-randomized version of a problem. In the new version, you can make it so the student can see the answer, the walk-through solution (if there is one), the hints (if there are any), and have access to the \menu{Check Answers} button. You will have the ability to control which problems this applies to. For more information, see \hyperref[SMA]{the section on Show Me Another}. This feature is supposed to serve as an analog to a solutions manual or textbook examples. + +If you think you will use this feature, you should go to \hyperref[SMA]{the section on Show Me Another} now and read about it. There may be some configuration settings that you would want to set \emph{before} you import or build any homework sets. + +\section{Adding/Dropping Students} +In the future, enrollment of students may be automated through Banner. For now, it falls upon you to enroll students and enter their information. + +\subsection{Adding Many Students at Once} +You may add a full roster of students to your \WW\ course all at once with minimal hassle if you do the following little dance with MyPCC and Excel. I recommend waiting until the weekend before classes start to follow the procedure below to minimize the hassle that comes with all the flux of enrollments right before a term begins. The goal is to create a plaintext \texttt{.csv} (comma separated value) file that has all the pertinent information in it. Each line of the file will have a student's information with no spaces, organized as:\\ + +\small +\centerline{\texttt{G-num,L-name,F-name,status,comment,section,recitation,email,login,password,permission}} +\normalsize +\vspace{1pc} + +If you understand all this so far then you may not need any further instruction. But more detailed step-by-step instructions follow. If you have trouble, send \href{mailto:alex.jordan@pcc.edu}{Alex Jordan} your full class roster in the form of the \texttt{.xls} file that you can download from MyPCC. + +\begin{enumerate} +\item In MyPCC, go to your \menu{Summary Class List}. At the bottom, there is a link to \menu{Download Roster}. Click on this and open the file with Excel. +\item Delete the first four columns so that G-numbers slide over to column \texttt{A}. Also delete the top two rows so that the remaining top row is actual student data. Note that you may have wait-listed students at the bottom. It's your choice to enroll them in \WW\ or not. You can always delete them (and any no-show students) later. +\item Highlight column \texttt{C}, and \menu{Insert} columns until the student email addresses are in column \texttt{H}. This should leave column \texttt{A} with G-numbers, \texttt{B} with names, several blank columns, \texttt{H} with email addresses, and more beyond that. Clear the contents of all columns beyond the email addresses. +\item Highlight the column of names. In the \menu{Data} menu, select \menu{Text to Columns}. Choose the \menu{Delimited} option. Add \menu{Comma} to the list of delimiters, and click \menu{Finish}. Column \texttt{B} should now have your students' \emph{last} names, and column \texttt{C} should have their \emph{first} names and middle initials. +\item Fill column \texttt{D} with the letter C. (You can enter a single C at the top of the column and drag it down the column's length.) The C stands for Currently enrolled. If a student is auditing, an A belongs here instead. +\item Columns \texttt{E} is for a comment about the student. I usually leave this blank, but make a note if a student is only on a wait list at that point. Column \texttt{F} is for noting the section. If there is only one CRN, I leave this blank. If there are multiple CRNs, I typically enter something like ``42483 TuTh morning'', and this will allow you to sort students by section and assign due dates differently to different sections. Column \texttt{G} is for recitation. At PCC, I don't see a need to enter anything here. But if you did, it would serve the same purpose as the section column, and just allow for multiple ways to sort. +\item Copy column \texttt{H} (which should still have email addresses) to column \texttt{I}. Highlight column \texttt{I} and add the +@ symbol to the list of delimiters by once again using \menu{Data}$\rightarrow$\menu{Text to Columns}. Clear all the \texttt{pcc.edu}s from column \texttt{J}. Now column \texttt{H} should \emph{still} have email addresses, and column \texttt{I} should have their user logins. +\item Leave column \texttt{J} blank. (This is where you could use a password hash from some earlier course. Leaving it blanks makes it so their student ID (G number) will be their initial password. Fill column \texttt{K} with the number 0. (This sets their permission level to \texttt{student} as opposed to say \texttt{professor}.) +\item Save the Excel document as a \texttt{.csv} file. Excel may give you warnings as you do this about losing data, but don't worry. +\end{enumerate} + +If you are putting multiple CRNs into one \WW\ course, then you can either repeat this process for each CRN, or you can make one big CSV file with all the courses. Just remember to distinguish the students by section using the section column. + +Your \texttt{.csv} file needs to be renamed to have a \texttt{.lst} (that's $\ell$\texttt{st}, not +$1$\texttt{st}) extension. If you have trouble doing that in your operating system, you can also rename the file within \WW. Use \WW's \menu{File Manager} to upload your \texttt{.lst} file straight to the \texttt{templates} directory. Check that it really does have the \texttt{.lst} extension (and if not, use the \menu{Rename} tool). Then in the \menu{Classlist Editor}, use \menu{Import users from file} to add all of these students to your \WW\ course. If any problem sets have already been created or imported, then you should now assign them to all of these new students by using the \menu{Instructor Tools}. + + +\subsection{Adding Students One (or a Small Number) at a Time} +In the \menu{Classlist Editor} there is a tab for adding students by hand. Fill in as much information as you can, but the minimum that is needed is a \menu{Login Name}, a \menu{Student ID}, and an \menu{Email Address}. Initial passwords will be the \menu{Student ID}s. As you individually add students this way, you may choose existing assignments to assign to these new students, or you can do this later using \menu{Instructor Tools}. + +If you are using the Achievements in your class, be sure to assign achievements to these newly-added users---see \hyperref[achievementslateaddstudents]{the section on assigning achievements to lately-added students}. + +\subsection{The Orientation Assignment} +There is an Orientation assignment for your students to take.\footnote{If you are not using \WW\ as a homework platform, there is probably no need for this.} This orientation tries to address common issues that students have when using \WW. Once you have your students enrolled, import the Orientation assignment by following the instructions in the \hyperref[orientation]{Orientation section}. Or if you are progressing through this document linearly, you can wait until you get there. \emph{Be sure to actually assign the Orientation to all students.} Simply importing the Orientation is not enough. + +\subsection{Removing Students} +\emph{Before the course begins}, you may remove students by deleting them in the \menu{Classlist Editor}. After a course has begun, it is strongly recommended that you \emph{drop} them, instead of \emph{deleting} them. To \emph{drop} a student, select their checkbox from the \menu{Classlist Editor} and \menu{Edit selected users}. Change their status. By dropping rather than deleting, the student's data is preserved, just in case it is needed. + +\subsection{Guest Accounts} +You can set up your course so that guests may log in. Guests may view problems from homework sets that have been assigned to the guest IDs. Their data is not stored. If the due date has not yet passed, guests may \emph{not} check their answers for correctness. If you would like to have guest accounts enabled, go to the \menu{Classlist Editor} and import users from the file \texttt{demoCourse.lst}. This creates ``students'' in your course list named practice1, practice2,\ldots,practice9. If such a ``student'' is part of your roster, then the login screen will have a \menu{Guest} login button. If you later wish to disable guest accounts, simply delete these ``students'' from the roster. + + +\section{Making a New Problem Set}\label{makeset} +Problem sets can either be imported from an earlier course or made from scratch. If your course came with problem sets that you would like to import\footnote{Of course, these may have an ordering that is not in line with your syllabus. Still, they are sets of vetted problems. So it might be worth importing them and learning how to modify these sets to meet your own needs.}, you may wish to skip ahead to the \hyperref[imp]{section on importing assignments}. Brand new users teaching MTH 8/20/60/61/62/63/65/70/95/111/243 should skip ahead and import the default assignments that are available (and then modify them if that is desired). If you have run this course before and wish to copy your old problem sets, you should skip ahead to the \hyperref[exp]{section on exporting assignments}. + +To create a new problem set from scratch, in the \HSE\ or the \menu{Library Browser}, you may \menu{Create} a new set and name it whatever you would like, just no periods or weird characters. You \emph{can} use spaces though For example, \texttt{Assignment 1} or \texttt{Chapter 3 Review} are good names. + +\subsection{Add Problems} To add problems to an assignment, go into the \menu{Library Browser}. Select the \menu{Target Set} from the dropdown menu. There are several sources of problems for you to browse. + +\begin{description} +\item{For MTH 60--70} select the \menu{Basic Algebra} library. From the \menu{Select a Problem Collection} drop-down menu, choose the relevant topic. These problems were written by Chris Hughes, Alex Jordan, and Carl Yao during summer 2013. Each problem has a walk-through solution, uses high-quality \WW\ coding techniques, and was written with accessibility standards in mind. + +\item{For MTH 20} select the \menu{Basic Math} library. These problems were coded by Carl Yao mostly over Fall 2013. Each problem has a walk-through solution, uses high-quality \WW\ coding techniques, and was written with accessibility standards in mind. + +\item{For MTH 111} select the \menu{College Algebra} library. These problems were coded by Alex Jordan mostly over Summer 2014. Each problem has a walk-through solution, uses high-quality \WW\ coding techniques, and was written with accessibility standards in mind. + +\item{For MTH 95} select the \menu{Math 95} library. These problems are generally not from a textbook and use randomization. These problems are currently being improved upon to reach the same standards as the 60/65 problems. MTH 95 overlaps some with MTH 60/65, and you will find usable problems in the Precollege Algebra library too. During Fall 2015, Carl Yao and Heiko Spoddeck will work to improve the quality of the MTH 95 problems. + +\item{For MTH 243} select the \menu{Statistics} library. These problems are generally not from a textbook and use randomization. These problems are currently being improved upon to reach the same standards as the 60/65 problems. + +\item{For physics problems} take a look in the \menu{CAPA} library. CAPA is an older online homework platform for physics problems, and some time ago an automated process converted CAPA problems to a state where \WW\ can use them. These problems do not necessarily use the best coding techniques, and they often come with pictures that currently do not have good alt tags for accessibility. + +\item{For \emph{any} course,} you may look for problems in the \menu{Open Problem Library}, formerly known as the \menu{National Problem Library}. These are sortable with a simple search or the \menu{Advanced Search}. Lastly try looking at the \menu{OPL Directory}, which organizes the OPL library according to who contributed the problems and what their indexing system was. The problems from Union College and the College of Idaho are notably well-written, but there are many institutions that have written good problems. +\end{description} + + +Click \menu{View Problems} to see the problems. The default is to see 20 at a time, but you can change this. You can click the re-randomize icon for each problem to see how its randomization behaves. Use the \menu{Add} button to add problems to the problem set you have targeted. + +\subsection{Set Description} +In the \HSE, after clicking in the numerical link for your set under \menu{Edit Problems}, there is a field to give a brief description of the set. When users hover their mouse over the name of the problem set, this description appears as a tooltip. For example, you could \emph{name} a homework set as \emph{Chapter20}, and give it a \emph{description} that is a little more detailed, like \emph{Hypothesis Testing for Population Proportions}. + + +\subsection{Assign the Set to Students} Use the \menu{Instructor Tools} to assign the set to students. At first, the problem set will have an opening date in the future, so there is no concern that students will log on and begin working before you have completed the setup. Of course, if you have not yet enrolled your students, you will need to come back to do this later. + +\subsection{Do the Assignment Yourself} This isn't really necessary. However, it is a good idea. This way, you will encounter issues before your students do. (If you find an issue with a problem, you can edit it, replace it with one that works, or ask someone who knows the \WW\ programming language to look into it.) + +Take notes concerning any input issues the problems have. Will students need to be reminded how to enter $\pi$ or $\infty$? Will they need to know that they should answer in function notation, as with $P(t)=1.1^t$ rather than just $1.1^t$? Well-written problems will make these issues clear. Take notes on issues like this that you come across and you can put them into the assignment header later. + +\subsection{Set Attempts} By default, \WW\ will allow students unlimited attempts for each problem (while keeping track of how many tries a student uses and recording their incorrect answers). In the \HSE, click the numerical link under the column \menu{Edit Problems} corresponding to the set in question. You probably want to change the \menu{Display Mode} for the \menu{Problems} to \menu{MathJax} or \menu{Images}, and then click \menu{Refresh Display}. Problem by problem, you may change the number of allowed attempts. + +For multiple choice questions, you may only want to allow one or two attempts. For matching questions, maybe more. I recommend allowing unlimited attempts for all other problems. Reasons for this are discussed below in the \hyperref[goodideas]{Good Ideas section}. + +\subsection{Set Show Me Another Threshold} If you have enabled the Show Me Another feature, then for each problem you can indicate how many attempts a student must use before they gain access to the \menu{Show Me Another} button. Setting this to $0$ will give students immediate access to the \menu{SMA} button for that problem. Setting this to $-1$ is the default, and this means that the student will never have access to the button. + +\subsection{Assignment Header} When a student opens an assignment, they see some text off to the right. The intent is to give information to the student that are specific to that assignment. You can tell students which chapters from the book are relevant, give links to places on the Internet, give tips on entering answers, etc. If you do nothing, then some default text will appear here. Best practice is to replace this text with your own instructions and warnings. + +Unfortunately, the source file that is used to print these messages is written in the language that \WW\ uses for generating problems, which is a combination of Perl, \LaTeX, and \WW-specific elements. For the uninitiated, writing this section from scratch would be difficult. + +Your \FM\ has a file called \texttt{ASimpleScreenHeaderFile.pg}. In the \HSE, click the numerical link under the column \menu{Edit Problems} corresponding to the set in question. In the big \menu{Headers} box, use the drop-down menu to select \texttt{ASimpleScreenHeaderFile.pg}. You should then \menu{Edit it} to make it relevant to the assignment you just created. After you have made your alterations, use the \menu{New Version} tab to save the file with a new name, and be sure to check the radio button that replaces the set's header file. Now students will see this nice header when they open this assignment. + +One advantage of exporting and importing old assignments is that you don't generally repeat the process of setting up header files---you just reuse your old header files. + +\subsection{Hardcopy Header} + +A large number of students will put their assignments into \texttt{.pdf} files, to work with offline, and then return to enter answers later. A \emph{different} header file called the \emph{hardcopy header} is used for printed versions. The lazy thing to do is to use the same screen set header that you just made. For technical reasons, this is not ideal. Formatting will be off---a minor concern. Somewhat more importantly, the characters $<$, $>$, $\{$, and $\}$ will not show up correctly. Even worse things may happen if you were using characters like \$, \^{}, \textunderscore, \%, etc. + +If you want to do things right, set the hardcopy header to \texttt{ASimpleHardCopyHeaderFile.pg} and then edit it in a similar way to how you created the screen header file. (Or you can just use your header as a hardcopy header and \emph{probably} nothing serious will go wrong.) + +\subsection{Set the Dates} In the \HSE, \menu{Edit} the set that you just put together. You may set the date that the problem set is available to students, the date that it is due, and the date that answers are made available to students. + +Be careful with setting the due time. It is tempting to use midnight, but don't use 12:00{\sc am}, since many students will confuse this with noon. Also, if you set a due time to 11:59{\sc pm} Tuesday in the fall, then the daylight savings changeover will make the due date become 12:59{\sc am} Wednesday, and some students will erroneously think that the assignment is due Wednesday at midnight. One last consideration---as a due date/time approaches, many students will log on. If this simultaneously happens across many courses, it has the potential to overload the server. For that reason, consider setting a due date/time that is in the middle of a weekday, when tech support is still available to get the server back up. + +I recommend that you set the \menu{answer date} (when answers and solutions become visible to students) to one or two days after the \menu{due date}. This is because you may want to grant an extension the day after an assignment was originally due, and you would not want the answers to have been made available in the meantime. + +Default due times and time lags between the three critical times for an assignment may be set in the \menu{Course Configuration}. + +\subsection{Reduced Credit Period}\label{reducedcredit} + +If you like, you may set a time period at the end of an assignment's window in which students only receive partial credit. The idea is that you really have an earlier due date in mind, but you are granting a penalized grace period for late submissions. If you plan to use this, go into the \menu{Course Configuration} and set both the duration of the reduced credit period, and the fraction at which you will offer reduced credit. You will then need to enable the reduced credit period for that particular assignment within the \HSE. \emph{Warning:} If say the due date is set to Friday and you set a 24 hour reduced credit period, then students will see a due date of Friday but only have until \emph{Thursday} to get full credit. This is explained to students alongside their due dates, but it is nevertheless potentially confusing. + +\section{Quizzes/Exams} + +With \WW\ you can create quizzes that students can take online, proctored or not. You can also use \WW\ to generate quizzes \emph{that are possibly different for each student} and print them off or have them taken at a computer station. Here is an outline of how to create a quiz/exam. +\begin{enumerate} +\item Create a `homework set' that will become the quiz; give it an appropriate name like Quiz1. Keep in mind that the set may draw randomly from a ``problem group'', discussed in \hyperref[groups]{Problem Groups}. (For example, problem number 5 on the exam could be a randomly chosen problem from a list of problems all having to do with solving a linear equation.) +\item In the set details for that set (in the \HSE\ click on the number for that set under the column \menu{Edit Problems}), use a drop down menu to turn the HW assignment into a quiz (either proctored or not) and save changes. +\item Set a bunch of parameters for the quiz that appear, discussed below. +\item If the quiz is proctored, arrange for a computer lab and proctor. Proctors either enter their own login information into each student's screen one at a time, or they can verbally give a password to all of the students in the room that will let them start. +\end{enumerate} + +To help you understand the multitude of options for a quiz, consider this scenario that an instructor may have put in place. Some of the chosen options may seem silly, but this example is just for demonstration. + +\hfill\begin{minipage}{0.9\textwidth} +The quiz becomes available on Monday morning at 12:00{\sc am} and the due date is Friday at 11:59{\sc pm}. Each student is allowed to take up to 3 versions of the quiz. Each new version will use new random seeds, so the questions will be different. Once a student starts a version, they have one hour to complete it. After the due date, an exam may not be started, but had a student started just before the due time, they do have a full hour. Each time a student is working on a version of the quiz, they may submit it twice for a grade (allowing them to make corrections after the first submission). In any 24 hour time interval, the student may start at most 2 versions. Problems are ordered randomly from student to student. Only three problems at a time are shown on each screen. Once a student has no remaining attempts or time for a version, they are granted access to their score for that version of the entire quiz. However, they do not get to see their scores or answers for the individual questions until after the due date. +\end{minipage} + +If you are new to \WW\ Gateway quizzes, I recommend that you try taking your own quiz and experimenting to check that you have all of the options the way you wish them to be. + +\subsection{Problem Groups}\label{groups} + +It is possible to define a collection of related problems, say all having to do with ``section 2.4'', and then have your quiz pull problems randomly from that set. (Unfortunately this feature is currently only available for \emph{quizzes}, not regular homework assignments.) This is especially useful if you want each student's quiz to be different from their neighbor's. + +This walkthrough explains how to do this for such a problem group. First, create an `assignment' consisting of all of the problems that you would like to group together. There is no need to assign this set to anyone. For an example, suppose we name this set \texttt{section2\_4problems}. + +Now in the assignment that will be the assigned quiz, in the \HSE, click on the number for this assignment in the {\bf Edit Problems} column. At the bottom, you can ``Add blank problem template to end of homework set''. If you wish for $n$ problems to be drawn from the list in \texttt{section2\_4problems}, then add $n$ blank slots. If you want to add more than $20$, you will need to do so in stages. + +Set the {\bf Source File} for each of the blanks to be \texttt{group:section2\_4problems}. Now set the options for the quiz and assign it to your students. + + + +\section{Importing and Exporting Assignments}\label{impexp} +\WW\ allows for you to be efficient in managing your courses from term to term. You can package up details of homework sets and quizzes all at once and then move them to a new course. + +\subsection{Exporting an Assignment}\label{exp} +At the end of the term, you may have put together several assignments and quizzes that you wish to keep for future courses, so that you do not have to build assignments from scratch in the future. To do this, you can \menu{Export} assignments from the \HSE. This creates a \texttt{.def} file containing the list of problems, how many attempts you chose, etc. If all of your problems came from public libraries and your header files were generic, then this will be enough. You can use the \FM\ to download the \texttt{.def} file, and import it later into your new course. A\texttt{.def} file is just a plain text file; it would be harmless to open one and you might learn something by seeing its structure. + +If the set used problem files that were local to your course (for example, if you modified a preexisting problem or wrote your own problems) then you must also copy these problem files. \emph{And} you will need to copy the header (set and hardcopy) files that you were using. \emph{And} you \emph{may} need to copy the contents of your \texttt{macros} folder. You can do this efficiently by highlighting +\begin{itemize} +\item all of your problem and header files (\texttt{.pg}) in the \FM\ (including any directories where you may have placed \texttt{.pg} files) +\item all of the set definition files (\texttt{.def}) that you made +\item the \texttt{macros} folder +\end{itemize} +and selecting \menu{Make Archive}. You will probably need to \Ctrl-click or Apple-click to select the three sources simultaneously. This creates a \texttt{.tgz} file compressing everything you highlighted. Download this \texttt{.tgz} file and store it. + +\subsection{Importing Assignments}\label{imp} +If you already have a \texttt{.def} file in your \FM, you can \menu{Import} it using the \HSE. At the moment that you import it, you can set an ``earliest date'' and all of the dates from the \texttt{.def} file will be shifted so that the earliest date corresponds to this. Otherwise you will need to use the \HSE\ to adjust the dates directly. + +If you are importing a set that you are bringing from an old course, then you need to go into your \FM\ and upload the \texttt{.def} or \texttt{.tgz} file that is described in \hyperref[exp]{Exporting an Assignment}. \WW\ should unpack the \texttt{.tgz} file automatically when it is uploaded to the \FM, and then delete the \texttt{.tgz} file. + +\subsection{Orientation Assignment}\label{orientation} +There is an orientation that is stored in the file \texttt{setOrientation.def}. You most likely need to import the orientation yourself, as described in \hyperref[imp]{Importing Assignments}. This Orientation tries to address the most common problems that students run into using \WW, and also make them aware of its more helpful features. I recommend that you assign it for some kind of credit. + +\section{Problems With Problems} +\WW\ problems are often coded with randomization, and sometimes the randomization gets out of hand and causes the problem to break down. Or the author of the problem may have just made a mistake. Because \WW\ is open source, these issues are quick to fix. Or you may just see a problem that you want to modify for other reasons. + +\subsection{Modifying an Existing Problem} + +You may find a problem in one of the problem collections that almost suits your needs, but not quite. For example, there are problems that ask students to solve inequalities and express the solution using \emph{both} interval notation and set-builder notation. You might want to use this problem, but remove the set-builder portion. + +To modify a problem, add it to your problem set in the usual way. Once it is part of an assignment, in the \HSE, click the numerical link under the column \menu{Edit Problems} corresponding to the set in question. Find the problem that you wish to edit, and click \menu{Edit it}. A new tab or window will open. + +Now you have been thrown into the world of \WW\ programming, but if you just want to make a simple modification, you should be able to make it without having to learn the PG language. Be aware that any modifications that you make will not change the library's version of the problem, but instead write a new problem just for you on your local directory. + +You will probably need to make three changes. +\begin{enumerate} +\item You'll want to find the section of the displayed text that you would like to change. The displayed part of a problem falls between the commands \verb=BEGIN_TEXT= and \verb=END_TEXT=. Or if it is a newer problem, between \verb=BEGIN_PGML= and \verb=END_PGML=. Find the part that you want to delete/edit and do so. + +\item If the problem is older and uses \verb=BEGIN_TEXT= and \verb=END_TEXT=, then answer blanks are produced in this same section with the command \verb=ans_rule()=. You may need to remove or add these. + +\item Scroll down to the bottom of the problem to see where the correct answer is compared with what a student puts into an answer blank. Usually, the command is something like \verb=ANS($ans->cmp());=, where \verb=$ans= is the variable storing the correct answer. You may need to remove, edit or add these commands too. Newer problems that use the \texttt{PGML} environment might declare the answer immediately after the answer blank instead of within an \texttt{ANS} command. +\end{enumerate} +If the problem is newer and uses \verb=BEGIN_PGML= and \verb=END_PGML=, then the fix might actually be so intuitive that you don't need special instruction. Otherwise, ask for help. + +After you have made your alterations, use the \menu{Update} (for local problems) or \menu{NewVersion} tab (for problems from a Library that you wish to make local) to save them. If making a new version, be sure to use the \menu{Replace current problem} button as you save. Make sure the file is saved with a \texttt{.pg} extension. Your new and improved version of the problem has replaced the original in the assignment. + +\subsection{Writing Your Own Problems} +If you would like to learn how to write your own problems, contact Chris, Alex, or Carl. You might get started by going to \url{http://webwork.maa.org/wiki/Category:Authors}. To examine code for a problem, find the problem in the \menu{Problem Library} (or an assignment), and click to \menu{Edit it}. You won't be editing the library's version---you'll be creating a new file on your local directory that can only be seen by you, not other instructors. + +Theoretically, the sky is the limit as far as what can be programmed. Not only does the Perl basis of the PG language provide for excellent algorithmic programming, but you can incorporate Flash and Java applets if you get real crazy. Contact someone with experience if you are interested and they will point you in some right directions. + +\subsection{If A Problem Turns Out To Be Truly Bad} +You can delete a problem from an assignment or choose to mark it correct for everyone. In the \HSE, click the numerical link under the column \menu{Edit Problems} corresponding to the set in question. Problem by problem, you can take either of these actions. + +\section{When You Receive a Student Email} +Students will ask you for help with problems through \WW's \menu{Email instructor} button. These emails come with a link to the page from where the student sent the request for help. Click that link, and you'll be asked to log on to \WW. You will be logged on as yourself, but (as you will see in the upper right corner of the screen) you will be acting as that student. This means that you will be seeing things from their perspective, in addition to all the extra menus and commands that instructors have access to. + +A useful tool to help diagnose their problem is to click the \menu{Show Past Answers} button at the bottom of the problem they are having trouble with. This opens another tab or window where you can see \emph{all} of the attempts they have made thus far. Most of the time, you can quickly diagnose their issue. + +Write them back quickly and you will really impress them. However they need to check their actual email---\WW\ itself will not alert them that they have a message from you. I recommend setting up your email to automatically tag these messages and filter them from your inbox. For filtering, all these messages have \texttt{[WWfeedback]} in the subject line. At regular intervals when you feel you have the time and are free from distractions, reply to your students. + +\section{Assessment} +\WW\ provides both formative and summative assessment tools. +\subsection{Scoring} +Use the \menu{Scoring Tools} to compute student grades on assignments. You may do this as often as you wish, just be sure that you wait until the due date to copy scores into your regular grade book. Note that when you score a problem set, a \texttt{.csv} file is created that you can open with Excel. You may need to delete rows from this \texttt{.csv} file that correspond to instructors, administrators, and dropped students before you copy and paste into the grade book. + +\subsection{Statistics} +The \menu{Statistics} menu helps you analyze class performance as a whole on assignments and individual problems. If you are vigilant, you can monitor which problem numbers cause the most issues for students and go over these in class. This is an excellent formative assessment tool and you may develop a weekly habit of using it to choose a review topic for class. + +\subsection{Student Progress} +View student progress with \menu{Student Progress}. This shows you how deep into the assignment students are, individually or as a class. If you suspect too many haven't even started, you can crack the whip. + + +\section{Editing Data: Change a Single Student's Scores, Attempts, or Due Dates} +Sometimes you may wish to give students credit for a problem even though WeBWorK wouldn't. Or you might wish to add extra attempts to a problem for a student. Or you might want to give one particular student an extension. + +In the \HSE, click the numerical link under the column \menu{Edit Assigned Users} corresponding to the set in question. Each student has a link to the left to \menu{Edit data} for them. + +\menu{Status} is a number (0 to 1) describing their score on each problem. You can change that here. Be sure to click \menu{Save Changes}. + +If you change due dates or attempts for that student, you must \emph{also check the box} next to the field. Again, be sure to click \menu{Save Changes}. + +\section{`Gamification' of \WW\ with Math Achievements}\label{gamification} + +Some research and a lot of anecdotal evidence suggests that we can improve our students' homework completion rates by adding gaming elements to the assignment. Users of ALEKS will be familiar with its pie, which is an example of this. + +\subsection{Math Achievements} + +Geoff Goehle from Western Carolina university developed a \WW\ module called Math Achievements to bring gamification to \WW. If you enable it, then students earn math achievement points alongside the normal points they earn on assignments in two ways. Firstly, they can earn achievement points for every correct problem they answer in their assignments. Secondly, when certain achievements are met (like The Early Bird, where a student has 100\% on an assignment within 24 hours of it opening) they get more points and a badge. Instructors can do what they will with these points---give some kind of extra credit or not. But as points accrue and tasks are met, students can ``level up'', eventually reaching ``Level 10 Professor''. + +If you enable Achievements, there are two options: \emph{without} items and \emph{with} items. Achievement items are earned when a student levels up. They are one-time use items that the students can use to get an edge on their grade, while having a little fun. The items earned at each level (in default conditions) are +\begin{enumerate} +\item Lesser Rod of Revelation---Gives a student an automatic 50\% on a single homework problem. +\item Potion of Forgetfulness---Resets the incorrect attempts counter to zero for a single problem. +\item Tunic of Extension---This allows a student to extend the due date of a currently open homework for 24 hours for full credit. +\item Cupcake of Enlargement---Doubles the weight of a single problem on a single homework set. +\item Box of Transmogrification---Allows a student to change the source file of a single problem to that of a different problem on the same homework set. +\item Greater Rod of Revelation---Gives a student an automatic 100\% on a single homework problem. +\item Robe of Longevity---This allows a student to extend the due date of a currently open homework for 48 hours for full credit. +\item Cake of Enlargement---This doubles the weight of all of the problems on a currently open homework assignment. A student could end up having a 200\% for their grade on one assignment if they use this. +\item Scroll of Resurrection---This reopens any homework set (even a closed one) for an additional 24 hours. The problem seeds are re-randomized, so the student won't be able to simply write down the answers while the set is closed, then resurrect it and enter them. +\item Greater Tome of Enlightenment---Gives a student an automatic 100\% on every problem in a set. This is a reward for having been diligent with homework throughout the term and cannot be earned without a lot of achievement points from badges and answering questions. +\end{enumerate} + +\subsection{Using Achievements without items} + + +If you would like to use Math Achievements without items, the first thing to do is go into the \menu{Course Configuration}, enable Math Achievements, and set the number of points that students earn for each problem\footnote{The default setup uses 5 points per problem and is based on about 200 problems per term. You can set the points per problem proportionately.}. This will add the \menu{Achievements} tool to all users' tool panels, and the \menu{Achievements Editor} to your instructor tools panel. In the \menu{Achievements Editor}, import the default achievements (\verb=default_achievements.axp=) and enable whichever ones you like. Achievements need to be `assigned' to your students. If you get creative, you can also write your own achievements by using the \menu{Edit Evaluator} link for an existing achievement. + + +\subsection{Using Achievements with items} + + +If you would like to use Math Achievements with items, the first thing to do is go into the \menu{Course Configuration}, enable Math Achievements \emph{and} Achievement Items, and set the number of points that students earn for each problem\footnote{The default setup uses 5 points per problem and is based on about 200 problems per term. You can set the points per problem proportionately.}. This will add the \menu{Achievements} tool to all users' tool panels, and the \menu{Achievements Editor} to your instructor tools panel. In the \menu{Achievements Editor}, import the default achievements (\verb=default_achievements_items.axp=) and enable whichever ones you like. Achievements need to be `assigned' to your students. If you get creative, you can also write your own achievements by using the \menu{Edit Evaluator} link for an existing achievement. + +\subsection{Challenge Problem Achievements} + +The default achievements that you can import are mostly ready to use immediately. The exception is the achievements that are classified as \verb=04_challenge= achievements. Here the idea is to have award badges for completing especially challenging problems. There are two ways to implement these: +\begin{itemize} +\item Create a special problem set that has all of the challenge problems that you intend to assign for the term. If you make the name of this set be \texttt{Challenge}, then these challenge achievements will work immediately. You can have up to ten problems in it. For more, you would need to create more achievements by using the \menu{Edit Evaluator} link on the \nth{10} challenge achievement and writing an \nth{11}, etc. +\item Locate the problems in your various problem sets that you would classify as challenge problems, and take note of the names of the sets they are inand what problem number they are within that set. Then use your \menu{Achievements Editor} to \menu{Edit Evaluator} for the challenge problem achievements. Where you see code like +\begin{verbatim} +my %validproblems = ( + 'Challenge' => { + '1' => 1, } + ); + \end{verbatim} +change the code to use the name of the homework set with the challenge problem and the problem number from that set. For example, if the the challenge problem is number 13 from the set \verb=Section2_4=, you might end up with +\begin{verbatim} +my %validproblems = ( + 'Section2_4' => { + '13' => 1, } + ); + \end{verbatim} +\end{itemize} + +Of course a third option is to just disable these challenge badges. And there is no harm in just leaving them as they are if you do not feel any problems that you have assigned are worthy of being called challenge problems. However, if you have the time and have some challenging problems, it adds a little more fun for your students. + +If you have made edits like this to the challenge achievements, you would want to consider the implications for exporting these changes to a new course in a subsequent term. Specifically, you would use the \menu{Achievements Editor} to \menu{Export} all of your chosen achievements to a \texttt{.axp} file. Then you would want to include the \texttt{achievements\textbackslash} folder during the \hyperref[exp]{export process}. + +\subsection{Assigning Achievements to lately-added students}\label{achievementslateaddstudents} +There may be times when you add students to the class after it has begun; once you have added the students to the class, you will need to assign the Achievements to them as a separate action. Go to the \menu{Achievement Editor}, and you should see that not all of the users in the class have been assigned the Achievements. Click on \menu{Assign} and then \menu{Select all}; be sure to keep the drop down box as \texttt{preserve existing data} so as not to erase the existing data of your currently-enrolled students. Once you have clicked \menu{Take Action!}, you should see that all of your users have been assigned all of the achievements. + +\section{Show Me Another}\label{SMA} + +Commercial online homework platforms often have a feature where a student can get a step by step solution for the problem they are working on, at the cost of having the problem that they were assigned re-randomized. \WW's Show Me Another Feature is like this, except that the version of the problem that was originally assigned to the student remains their assigned version, and they can see solutions to the \emph{newly} seeded problem. It is worth noting that if \WW\ is unable to generate a new version of the problem that is different from the version that is actually assigned, then it will tell the student this, and that this feature is unavailable for this problem. + +There are several checks in place to allow you to customize how this feature is used. First of all, in the \menu{Course Configuration} you decide what elements of the newly seeded problem the student will have access to. There are four options, any subset of which can be enabled. +\begin{itemize} +\item Walk-through solutions: if the newly seeded version has a walkthrough solution, then the student will be able to see it. This is the option that makes SMA a parallel to MyMathLab's Show Me How button. +\item Answers: this is redundant if you have enabled the walkthrough solutions and there is a walkthrough solution. But otherwise, it let's students see what answer was expected for the newly seeded version. +\item Hints: some \WW\ problems are coded with hints that are revealed depending on a global setting by the instructor and how many attempts the student has used. With this checked, students have access to the newly seeded version's hints regardless of other settings. +\item Check answers: this gives the student the ability to enter an answer for the newly seeded version and have \WW\ check if it is correct. This would be most useful if the walk-through solutions and answers have not been enabled. +\end{itemize} + +Personally, I tend to always offer SMA with the Check answers option turned on, and all other elements turned off. This gives motivated students opportunity for extra practice. There's nothing wrong with turning on the other options, but it's just not my style. I \emph{do} turn on all the other options if I am creating a \WW\ course whose purpose is self-study instead of homework. + +The other thing to set in \menu{Course Configuration} is the number of times a student may use \menu{Show Me Another} for each problem. Maybe you wouldn't care to allow your student to use this button over and over again on any one problem forever. Personally, I set this to $-1$, which is code for ``there is no limit''. + +Lastly, you very well might like this feature to be enabled for some problems, but not all. For this reason, in the \menu{Set Details} page for a problem set (accessible through the \HSE, and then clicking on the number of problems within the set), you can set the threshold of attempts that a student must use before the button becomes available to them. For example, it is set to $2$, then they must attempt the problem twice before the button is available. If you want the button to be immediately available, set the threshold to $0$. If you want the button to never never be available for that problem, then convention is to use $-1$. + +\emph{Important:} If you are importing one of the PCC default homework sets, then every problem's threshold number will be $-1$. If you want them to be $0$, or $2$, or whatever, it would be extremely tedious to change the threshold manually for each problem. So \emph{before} you import the problem set(s), go to the \FM, navigate up one folder, and edit the file \texttt{course.conf}. Find a blank line anywhere near the bottom and paste the line +\begin{center} +\verb=$problemDefaults{showMeAnother}=2;= +\end{center} +or of course use some number other than $2$. Save, and \emph{then} import your problem sets. They will all have their SMA threshold set to whatever setting you made. + +\section{Good Ideas to Keep Everything Running Smoothly}\label{goodideas} + +\begin{itemize} +\item Respond as soon as you can to students' requests for assistance. A fast response rate really improves students' attitudes about using \WW. Students cite this fast response rate as one of the top two reasons for liking \WW. (The other is the immediate feedback from \WW\ itself.) + +\item Test the problems that you assign by assigning the homework sets to yourself, and running through all the problems. Many of the problems are freshly programmed and there are bound to be some mistakes. Right now the easiest way to handle this is to use the \menu{Email Instructor} button from the offending problem to send yourself a message. Then forward that email to Alex, Carl, or Chris. + +\item While you do the problems yourself, make note of any special `computer language' that is necessary for completing the set. For example, that you enter $\pi$ as \texttt{pi}. Write all this down and include it in the set header. Mention these items in class too. + +\item Consider giving unlimited attempts to problems. If the underlying philosophy is that homework is a learning device and not a testing mechanism, then the good that comes from unlimited attempts outweighs the bad. +\begin{itemize} +\item Students are encouraged by the ability to keep trying to solve a problem until they get it right. + +\item There will be some problems where students will swear up and down that they are correct, yet \WW\ marks them incorrect because they `do not know the computer language'. (Sometimes this has merit, but much more often they simply have wrong answers.) They become really upset \emph{if they use up all of their attempts} while completely confident that they are correct. A negative attitude is more than just a pain for you -- it could reduce the effectiveness of \WW\ as a learning tool. + +\item Suppose that a poorly programmed question escapes your notice during your preview of the assignment. Suppose that you make the call to alter the problem to fix the issue, as is outlined in a section above. Suppose that students have \emph{limited} attempts. By the time you make your changes, several students may have used up all their attempts, and you would need to deal with that. + +\item I find that some proud/too-polite students will not ask for help until they have tried many ($>\!\!10$) attempts. With limited attempts, these students might just move on after using up their attempts, and never ask for help. + +\end{itemize} + +There will rarely be an opportunity for exhaustive guessing to lead to correct answers. When a problem does lend itself to exhaustive guessing (e.g.\ a matching problem), of course that is a good time to limit attempts. + +\item Use the \menu{Statistics} menu to identify which problems are generally causing trouble for your students that you could go over in class. + +\item Use an `attempt threshold' to encourage an email request for help. For example, you might say ``Email me for help if you are still stuck after five attempts.'' + +\item Make sure students are aware of the tools they have: +\begin{itemize} +\item The \menu{Email Instructor} button +\item The feedback messages (which students often overlook) +\item Printing hard copies +\item PCC computer access +\item Viewing answers after the answer date +\end{itemize} +The Orientation assignment tries to make them aware of most of these, but redundancy (like mentioning these things every now and then) is helpful. + +\item Give your students a short guide similar to this one, but for students. (I've made one that you are welcome to use or edit.) + +\item If you are using questions that come from a textbook, assign even numbered problems (problems without answers in the back of the book.) Obviously, you don't want a slacker student to just enter the answers from the back. More importantly, the reasoning behind assigning odd problems is one-upped with \WW. The purpose of assigning odd problems is so that students can see for themselves when they are incorrect. \WW\ can do this \emph{without} simultaneously giving away what \emph{is} correct. + +\item If you are using problems that have randomization, encourage students to work together. They will not be simply able to give each other answers; they will need to communicate process to each other. This kind of collaborative learning is good for all involved, and the randomization serves as a countermeasure to outright cheating. + + + + +\end{itemize} + +\end{document} + + + diff --git a/test-cases/oneSentencePerLine/webwork-guidemod0.tex b/test-cases/oneSentencePerLine/webwork-guidemod0.tex new file mode 100644 index 00000000..e2b4bdf1 --- /dev/null +++ b/test-cases/oneSentencePerLine/webwork-guidemod0.tex @@ -0,0 +1,850 @@ +% https://raw.githubusercontent.com/Alex-Jordan/WeBWorKUserGuide/master/WeBWorKUserGuide.tex +% arara: pdflatex +% arara: pdflatex +\documentclass[12pt]{article} + +\usepackage[charter]{mathdesign} % changes font + +\usepackage[margin=2cm]{geometry} +\usepackage{keystroke,dsfont,verbatim} +\usepackage[super]{nth} +\usepackage[colorlinks=true, linkcolor=blue]{hyperref} + +\newcommand{\menu}[1]{\textbf{#1}} +\newcommand{\WW}{WeBWorK} +\newcommand{\HSE}{\menu{Hmwk Sets Editor}} +\newcommand{\FM}{\menu{File Manager}} + +\setlength{\parindent}{0mm} +\setcounter{secnumdepth}{0} + +\title{\WW\ User Guide for PCC Instructors} +\author{Alex Jordan\\\href{mailto:alex.jordan@pcc.edu}{alex.jordan@pcc.edu}} + +\begin{document} + +\maketitle + +This document is meant to serve two purposes. +For PCC faculty who are already familiar with \WW, this is meant to be a reference. +From the table of contents you may hyperlink to any topic. +For PCC faculty who are new to \WW, the document can be used linearly as you set up your course. + +\footnotesize +\setcounter{tocdepth}{2} +\tableofcontents + +\setlength{\parskip}{10pt} + +\newpage +\normalsize + +\section{Overview} + +\WW\ is accessed through a web browser. +Its primary purpose is for your students to submit mathematical answers to homework problems. +It has several other uses including timed exams, placement testing, data-gathering, and general collection of (not necessarily mathematical) student responses. + +You will have access to several libraries of problems, each problem of which is coded in the form of a plain text file. +A \emph{homework set} is a list of problems from these libraries together with a due date and certain other options. +When a homework set has been created, you assign it to your students, or subsets of your students. +\WW\ keeps track of all student input and their scores. +Note that a \emph{homework set} does not need to literally be a homework set. +It could be a review set, an exam, a survey, reading material, etc. + +Your role\footnote{More complicated roles are possible. +} is to: +\begin{enumerate} + \item Add your students to the course and choose some initial configuration settings. + \item Create the problem sets. + I recommend getting this all laid out before the term starts. + It is a one-day investment that will reduce your workload during the term. + You will have complete flexibility to change anything later. + For future versions of the same course, this process is very fast; you can copy an old setup and just change dates. + \item Respond to student emails for help. \WW\ will allow students to email you rather effortlessly for help. + Since the volume of email that this creates can get large, I recommend setting up an email filter to separate any incoming message with [WWfeedback] in the subject header. + When you have time and are in the right mindset to respond to student emails, you can go through this pile more efficiently. + \item Put out occasional fires. + Maybe a student forgets their password. + Maybe you want to grant an extension to an assignment. + Maybe there is a code issue with a problem that you have assigned (in which case you may need to call for help. + ) + \item Gather the grades from \WW\ and import them into your grade book. +\end{enumerate} + +If you are brand new to \WW\, then I suggest progressing in a straight line through this guide. +You will know when it is OK to skip something. +If you have more than one section of a course, then focus on one section first. +You will be able to quickly copy your setup once the first section is in good shape. +If you are not new to \WW\, then consider this document to be a reference guide. + +\section{Logging On and Passwords} + +Unless you have a special case,\footnote{Some special courses may have a different structure to their address. +} your course is located at (using all lowercase letters): +\begin{center} + \href{http://webwork.pcc.edu/webwork2/}{\texttt{http://webwork.pcc.edu/webwork2/aaabbb-ccccc-lastname}}\\ + or at\\ + \href{http://webwork.pcc.edu/webwork2/}{\texttt{http://webwork.pcc.edu/webwork2/aaabbb-astname-term}} +\end{center} where \texttt{aaa} is your subject code (mth, cs, etc.), \texttt{bbb} is your course number (060, 111, etc.), \texttt{xxxxx} is your CRN, \texttt{lastname} is your last name, and \texttt{term} is something like \texttt{f15}. +You can ask to remove your last name from the CRN-specific address, but having it there can make it easy to find your own courses from among the list at \url{webwork. + pcc.edu}. +Make a bookmark with this link at your work station---you will need to come here often. +For your students, you should make a link in MyPCC under the \menu{Links} section. +(Don't make them have to directly type the awkward web address.) It's also possible that your course is listed at \href{http://webwork.pcc.edu/webwork2/}{http://webwork.pcc.edu/webwork2/}, but it may be hidden. + +In most cases, everyone's login should be their complete PCC email prefix, using \emph{all lowercase} letters. +If your email is \texttt{jane. + doe15@pcc.edu}, your login should be \texttt{jane.doe15}. +The default password should be your G-number, using \emph{a capital G}. +It might be your old password if you have used \WW\ before. +If you cannot log on, contact \href{mailto:alex. + jordan@pcc.edu}{Alex Jordan} (SY) or Carl Yao (SE), each of whom has administrative access to your account. +Everyone (especially instructors and TAs) should change their password the first time that they log in. +This is done using the \menu{Password/Email} item under \WW's main menu. + +\section{Initial Setup} +When you first receive your \WW\ course, there are a few items to initialize. +On the home screen when you log in, you will see \menu{Course Info} off to the right. +You should \menu{[edit]} this, providing all students with some basic course information. +You may use \href{http://en. + wikipedia.org/wiki/HTML_element}{html tags} to improve the look of this section or link to other web resources, but that's not necessary. (This is all stored in your course's \FM\ as \verb=course_info.txt= if you would like to access that file directly.) + +%You can also include a text file (with html if you like) to display information at the login screen. This file should be stored in your \FM\ as \verb=login_info.txt=. The default gives helpful information to students about how to log in. + +Next, there are some options you might want to tend to in the \menu{Course Configuration} menu. +Browse through all five tabs in the \menu{Course Configuration} menu. +All options should be set to something reasonable by default. +If you understand what an option does, feel free to change it. +Of course if you do not understand an option, leave it alone or feel free to ask about it. +The most common items you may want to change settings for are: + +\subsection{Enable Conditional Release} + +If you would like to make it possible to conditionally release homework assignments, you can enable this option. +For example, this can be used to make it so that Assignment \#2 is not available until a student has say a 90\% on Assignment \#1, etc. + +\subsection{Course Achievements} + +\WW\ has a feature called Course Achievements. +This is a way to award achievement points (separate from regular homework points), badges, levels, and special items to students to make the whole experience more like a game. +For many students, this `gamification' of homework is motivational. +If you like, enable Course Achievements in the \menu{Course Configuration} menu. +Once you do this, your navigation panel will have an \menu{Achievements Editor} in the instructor tools. +Also, all users will have an \menu{Achievements} menu to monitor their achievements. +To make use of this feature, you need to import achievements and assign them to your students. +This is discussed in more detail in the \hyperref[gamification]{Gamification} section. + +\subsection{Enabling MathView} + +This is a palette tools that may make it easier for students to enter complicated expressions. +If it is enabled, there will be an icon next to each answer blank. +Clicking this icon will open an applet window that allows students to construct an expression with radicals, fractions, and more using a palette similar to MathType (but with few complications). +MathView is enabled by default. +If a student has a MathView window open, then they can see the ``pretty-print'' version of their answer as they type it. +For example, as they type \texttt{(x+1)/x}, they will see this sequence appear character by character: $$(\qquad(x\qquad(x+\qquad(x+1\qquad(x+1)\qquad\frac{x+1}{}\qquad\frac{x+1}{x}$$ + +\subsection{Reduced Scoring for Late Work} + +Your assignments will each have a due date/time. +If you like, you may allow students to work beyond the due date/time for reduced credit. +If you plan to use this for any homework sets \begin{itemize} \item Enable Reduced Scoring \item Set the Length of Reduced Scoring Period in minutes \item Set the Value of work done in Reduced Scoring Period \end{itemize} Later when you create an assignment, you will \emph{still} need to enable reduced scoring for that particular assignment within the \HSE, since it is possible to have some assignments use reduced scoring and other assignments not use it. +You can \hyperref[reducedcredit]{read about this} in the \hyperref[makeset]{section on creating homework sets}. + +\emph{Warning:} +If you use this feature, there is currently an unfortunate arrangement. +The displayed due date will be the date and time beyond which students cannot submit \emph{any} more answers. +The reduced credit period begins \emph{prior} to this. +\WW\ \emph{does} explain this to students alongside the due date, but this arrangement is potentially confusing. + +\subsection{Show Me Another Button} + +If you enable this feature, then you will have the ability to make it so that a student can see a re-randomized version of a problem. +In the new version, you can make it so the student can see the answer, the walk-through solution (if there is one), the hints (if there are any), and have access to the \menu{Check Answers} button. +You will have the ability to control which problems this applies to. +For more information, see \hyperref[SMA]{the section on Show Me Another}. +This feature is supposed to serve as an analog to a solutions manual or textbook examples. + +If you think you will use this feature, you should go to \hyperref[SMA]{the section on Show Me Another} now and read about it. +There may be some configuration settings that you would want to set \emph{before} you import or build any homework sets. + +\section{Adding/Dropping Students} +In the future, enrollment of students may be automated through Banner. +For now, it falls upon you to enroll students and enter their information. + +\subsection{Adding Many Students at Once} +You may add a full roster of students to your \WW\ course all at once with minimal hassle if you do the following little dance with MyPCC and Excel. +I recommend waiting until the weekend before classes start to follow the procedure below to minimize the hassle that comes with all the flux of enrollments right before a term begins. +The goal is to create a plaintext \texttt{. + csv} (comma separated value) file that has all the pertinent information in it. +Each line of the file will have a student's information with no spaces, organized as:\\ + +\small \centerline{\texttt{G-num,L-name,F-name,status,comment,section,recitation,email,login,password,permission}} \normalsize \vspace{1pc} + +If you understand all this so far then you may not need any further instruction. +But more detailed step-by-step instructions follow. +If you have trouble, send \href{mailto:alex. + jordan@pcc.edu}{Alex Jordan} your full class roster in the form of the \texttt{.xls} file that you can download from MyPCC. + +\begin{enumerate} + \item In MyPCC, go to your \menu{Summary Class List}. + At the bottom, there is a link to \menu{Download Roster}. + Click on this and open the file with Excel. + \item Delete the first four columns so that G-numbers slide over to column \texttt{A}. + Also delete the top two rows so that the remaining top row is actual student data. + Note that you may have wait-listed students at the bottom. + It's your choice to enroll them in \WW\ or not. + You can always delete them (and any no-show students) later. + \item Highlight column \texttt{C}, and \menu{Insert} columns until the student email addresses are in column \texttt{H}. + This should leave column \texttt{A} with G-numbers, \texttt{B} with names, several blank columns, \texttt{H} with email addresses, and more beyond that. + Clear the contents of all columns beyond the email addresses. + \item Highlight the column of names. + In the \menu{Data} menu, select \menu{Text to Columns}. + Choose the \menu{Delimited} option. + Add \menu{Comma} to the list of delimiters, and click \menu{Finish}. + Column \texttt{B} should now have your students' \emph{last} names, and column \texttt{C} should have their \emph{first} names and middle initials. + \item Fill column \texttt{D} with the letter C. (You can enter a single C at the top of the column and drag it down the column's length.) The C stands for Currently enrolled. + If a student is auditing, an A belongs here instead. + \item Columns \texttt{E} is for a comment about the student. + I usually leave this blank, but make a note if a student is only on a wait list at that point. + Column \texttt{F} is for noting the section. + If there is only one CRN, I leave this blank. + If there are multiple CRNs, I typically enter something like ``42483 TuTh morning'', and this will allow you to sort students by section and assign due dates differently to different sections. + Column \texttt{G} is for recitation. + At PCC, I don't see a need to enter anything here. + But if you did, it would serve the same purpose as the section column, and just allow for multiple ways to sort. + \item Copy column \texttt{H} (which should still have email addresses) to column \texttt{I}. + Highlight column \texttt{I} and add the @ symbol to the list of delimiters by once again using \menu{Data}$\rightarrow$\menu{Text to Columns}. + Clear all the \texttt{pcc. + edu}s from column \texttt{J}. + Now column \texttt{H} should \emph{still} have email addresses, and column \texttt{I} should have their user logins. + \item Leave column \texttt{J} blank. (This is where you could use a password hash from some earlier course. + Leaving it blanks makes it so their student ID (G number) will be their initial password. + Fill column \texttt{K} with the number 0. + (This sets their permission level to \texttt{student} as opposed to say \texttt{professor}.) + \item Save the Excel document as a \texttt{.csv} file. + Excel may give you warnings as you do this about losing data, but don't worry. +\end{enumerate} + +If you are putting multiple CRNs into one \WW\ course, then you can either repeat this process for each CRN, or you can make one big CSV file with all the courses. +Just remember to distinguish the students by section using the section column. + +Your \texttt{. + csv} file needs to be renamed to have a \texttt{.lst} (that's $\ell$\texttt{st}, not +$1$\texttt{st}) extension. +If you have trouble doing that in your operating system, you can also rename the file within \WW. +Use \WW's \menu{File Manager} to upload your \texttt{. + lst} file straight to the \texttt{templates} directory. +Check that it really does have the \texttt{. + lst} extension (and if not, use the \menu{Rename} tool). +Then in the \menu{Classlist Editor}, use \menu{Import users from file} to add all of these students to your \WW\ course. +If any problem sets have already been created or imported, then you should now assign them to all of these new students by using the \menu{Instructor Tools}. + +\subsection{Adding Students One (or a Small Number) at a Time} +In the \menu{Classlist Editor} there is a tab for adding students by hand. +Fill in as much information as you can, but the minimum that is needed is a \menu{Login Name}, a \menu{Student ID}, and an \menu{Email Address}. +Initial passwords will be the \menu{Student ID}s. +As you individually add students this way, you may choose existing assignments to assign to these new students, or you can do this later using \menu{Instructor Tools}. + +If you are using the Achievements in your class, be sure to assign achievements to these newly-added users---see \hyperref[achievementslateaddstudents]{the section on assigning achievements to lately-added students}. + +\subsection{The Orientation Assignment} +There is an Orientation assignment for your students to take. +\footnote{If you are not using \WW\ as a homework platform, there is probably no need for this.} +This orientation tries to address common issues that students have when using \WW. +Once you have your students enrolled, import the Orientation assignment by following the instructions in the \hyperref[orientation]{Orientation section}. +Or if you are progressing through this document linearly, you can wait until you get there. +\emph{Be sure to actually assign the Orientation to all students.} +Simply importing the Orientation is not enough. + +\subsection{Removing Students} +\emph{Before the course begins}, you may remove students by deleting them in the \menu{Classlist Editor}. +After a course has begun, it is strongly recommended that you \emph{drop} them, instead of \emph{deleting} them. +To \emph{drop} a student, select their checkbox from the \menu{Classlist Editor} and \menu{Edit selected users}. +Change their status. +By dropping rather than deleting, the student's data is preserved, just in case it is needed. + +\subsection{Guest Accounts} +You can set up your course so that guests may log in. +Guests may view problems from homework sets that have been assigned to the guest IDs. +Their data is not stored. +If the due date has not yet passed, guests may \emph{not} check their answers for correctness. +If you would like to have guest accounts enabled, go to the \menu{Classlist Editor} and import users from the file \texttt{demoCourse. + lst}. +This creates ``students'' in your course list named practice1, practice2,\ldots,practice9. +If such a ``student'' is part of your roster, then the login screen will have a \menu{Guest} login button. +If you later wish to disable guest accounts, simply delete these ``students'' from the roster. + +\section{Making a New Problem Set}\label{makeset} +Problem sets can either be imported from an earlier course or made from scratch. +If your course came with problem sets that you would like to import\footnote{Of course, these may have an ordering that is not in line with your syllabus. + Still, they are sets of vetted problems. + So it might be worth importing them and learning how to modify these sets to meet your own needs. +}, you may wish to skip ahead to the \hyperref[imp]{section on importing assignments}. +Brand new users teaching MTH 8/20/60/61/62/63/65/70/95/111/243 should skip ahead and import the default assignments that are available (and then modify them if that is desired). +If you have run this course before and wish to copy your old problem sets, you should skip ahead to the \hyperref[exp]{section on exporting assignments}. + +To create a new problem set from scratch, in the \HSE\ or the \menu{Library Browser}, you may \menu{Create} a new set and name it whatever you would like, just no periods or weird characters. +You \emph{can} use spaces though For example, \texttt{Assignment 1} or \texttt{Chapter 3 Review} are good names. + +\subsection{Add Problems} +To add problems to an assignment, go into the \menu{Library Browser}. +Select the \menu{Target Set} from the dropdown menu. +There are several sources of problems for you to browse. + +\begin{description} + \item{For MTH 60--70} select the \menu{Basic Algebra} library. + From the \menu{Select a Problem Collection} drop-down menu, choose the relevant topic. + These problems were written by Chris Hughes, Alex Jordan, and Carl Yao during summer 2013. + Each problem has a walk-through solution, uses high-quality \WW\ coding techniques, and was written with accessibility standards in mind. + + \item{For MTH 20} select the \menu{Basic Math} library. + These problems were coded by Carl Yao mostly over Fall 2013. + Each problem has a walk-through solution, uses high-quality \WW\ coding techniques, and was written with accessibility standards in mind. + + \item{For MTH 111} select the \menu{College Algebra} library. + These problems were coded by Alex Jordan mostly over Summer 2014. + Each problem has a walk-through solution, uses high-quality \WW\ coding techniques, and was written with accessibility standards in mind. + + \item{For MTH 95} select the \menu{Math 95} library. + These problems are generally not from a textbook and use randomization. + These problems are currently being improved upon to reach the same standards as the 60/65 problems. + MTH 95 overlaps some with MTH 60/65, and you will find usable problems in the Precollege Algebra library too. + During Fall 2015, Carl Yao and Heiko Spoddeck will work to improve the quality of the MTH 95 problems. + + \item{For MTH 243} select the \menu{Statistics} library. + These problems are generally not from a textbook and use randomization. + These problems are currently being improved upon to reach the same standards as the 60/65 problems. + + \item{For physics problems} take a look in the \menu{CAPA} library. + CAPA is an older online homework platform for physics problems, and some time ago an automated process converted CAPA problems to a state where \WW\ can use them. + These problems do not necessarily use the best coding techniques, and they often come with pictures that currently do not have good alt tags for accessibility. + + \item{For \emph{any} course,} you may look for problems in the \menu{Open Problem Library}, formerly known as the \menu{National Problem Library}. + These are sortable with a simple search or the \menu{Advanced Search}. + Lastly try looking at the \menu{OPL Directory}, which organizes the OPL library according to who contributed the problems and what their indexing system was. + The problems from Union College and the College of Idaho are notably well-written, but there are many institutions that have written good problems. +\end{description} + +Click \menu{View Problems} to see the problems. +The default is to see 20 at a time, but you can change this. +You can click the re-randomize icon for each problem to see how its randomization behaves. +Use the \menu{Add} button to add problems to the problem set you have targeted. + +\subsection{Set Description} +In the \HSE, after clicking in the numerical link for your set under \menu{Edit Problems}, there is a field to give a brief description of the set. +When users hover their mouse over the name of the problem set, this description appears as a tooltip. +For example, you could \emph{name} a homework set as \emph{Chapter20}, and give it a \emph{description} that is a little more detailed, like \emph{Hypothesis Testing for Population Proportions}. + +\subsection{Assign the Set to Students} +Use the \menu{Instructor Tools} to assign the set to students. +At first, the problem set will have an opening date in the future, so there is no concern that students will log on and begin working before you have completed the setup. +Of course, if you have not yet enrolled your students, you will need to come back to do this later. + +\subsection{Do the Assignment Yourself} +This isn't really necessary. +However, it is a good idea. +This way, you will encounter issues before your students do. +(If you find an issue with a problem, you can edit it, replace it with one that works, or ask someone who knows the \WW\ programming language to look into it.) + +Take notes concerning any input issues the problems have. +Will students need to be reminded how to enter $\pi$ or $\infty$? +Will they need to know that they should answer in function notation, as with $P(t)=1. + 1^t$ rather than just $1.1^t$? +Well-written problems will make these issues clear. +Take notes on issues like this that you come across and you can put them into the assignment header later. + +\subsection{Set Attempts} +By default, \WW\ will allow students unlimited attempts for each problem (while keeping track of how many tries a student uses and recording their incorrect answers). +In the \HSE, click the numerical link under the column \menu{Edit Problems} corresponding to the set in question. +You probably want to change the \menu{Display Mode} for the \menu{Problems} to \menu{MathJax} or \menu{Images}, and then click \menu{Refresh Display}. +Problem by problem, you may change the number of allowed attempts. + +For multiple choice questions, you may only want to allow one or two attempts. +For matching questions, maybe more. +I recommend allowing unlimited attempts for all other problems. +Reasons for this are discussed below in the \hyperref[goodideas]{Good Ideas section}. + +\subsection{Set Show Me Another Threshold} +If you have enabled the Show Me Another feature, then for each problem you can indicate how many attempts a student must use before they gain access to the \menu{Show Me Another} button. +Setting this to $0$ will give students immediate access to the \menu{SMA} button for that problem. +Setting this to $-1$ is the default, and this means that the student will never have access to the button. + +\subsection{Assignment Header} +When a student opens an assignment, they see some text off to the right. +The intent is to give information to the student that are specific to that assignment. +You can tell students which chapters from the book are relevant, give links to places on the Internet, give tips on entering answers, etc. +If you do nothing, then some default text will appear here. +Best practice is to replace this text with your own instructions and warnings. + +Unfortunately, the source file that is used to print these messages is written in the language that \WW\ uses for generating problems, which is a combination of Perl, \LaTeX, and \WW-specific elements. +For the uninitiated, writing this section from scratch would be difficult. + +Your \FM\ has a file called \texttt{ASimpleScreenHeaderFile. + pg}. +In the \HSE, click the numerical link under the column \menu{Edit Problems} corresponding to the set in question. +In the big \menu{Headers} box, use the drop-down menu to select \texttt{ASimpleScreenHeaderFile. + pg}. +You should then \menu{Edit it} to make it relevant to the assignment you just created. +After you have made your alterations, use the \menu{New Version} tab to save the file with a new name, and be sure to check the radio button that replaces the set's header file. +Now students will see this nice header when they open this assignment. + +One advantage of exporting and importing old assignments is that you don't generally repeat the process of setting up header files---you just reuse your old header files. + +\subsection{Hardcopy Header} + +A large number of students will put their assignments into \texttt{. + pdf} files, to work with offline, and then return to enter answers later. +A \emph{different} header file called the \emph{hardcopy header} is used for printed versions. +The lazy thing to do is to use the same screen set header that you just made. +For technical reasons, this is not ideal. +Formatting will be off---a minor concern. +Somewhat more importantly, the characters $<$, $>$, $\{$, and $\}$ will not show up correctly. +Even worse things may happen if you were using characters like \$, \^{}, \textunderscore, \%, etc. + +If you want to do things right, set the hardcopy header to \texttt{ASimpleHardCopyHeaderFile. + pg} and then edit it in a similar way to how you created the screen header file. (Or you can just use your header as a hardcopy header and \emph{probably} nothing serious will go wrong.) + +\subsection{Set the Dates} +In the \HSE, \menu{Edit} the set that you just put together. +You may set the date that the problem set is available to students, the date that it is due, and the date that answers are made available to students. + +Be careful with setting the due time. +It is tempting to use midnight, but don't use 12:00{\sc am}, since many students will confuse this with noon. +Also, if you set a due time to 11:59{\sc pm} Tuesday in the fall, then the daylight savings changeover will make the due date become 12:59{\sc am} Wednesday, and some students will erroneously think that the assignment is due Wednesday at midnight. +One last consideration---as a due date/time approaches, many students will log on. +If this simultaneously happens across many courses, it has the potential to overload the server. +For that reason, consider setting a due date/time that is in the middle of a weekday, when tech support is still available to get the server back up. + +I recommend that you set the \menu{answer date} (when answers and solutions become visible to students) to one or two days after the \menu{due date}. +This is because you may want to grant an extension the day after an assignment was originally due, and you would not want the answers to have been made available in the meantime. + +Default due times and time lags between the three critical times for an assignment may be set in the \menu{Course Configuration}. + +\subsection{Reduced Credit Period}\label{reducedcredit} + +If you like, you may set a time period at the end of an assignment's window in which students only receive partial credit. +The idea is that you really have an earlier due date in mind, but you are granting a penalized grace period for late submissions. +If you plan to use this, go into the \menu{Course Configuration} and set both the duration of the reduced credit period, and the fraction at which you will offer reduced credit. +You will then need to enable the reduced credit period for that particular assignment within the \HSE. +\emph{Warning:} +If say the due date is set to Friday and you set a 24 hour reduced credit period, then students will see a due date of Friday but only have until \emph{Thursday} to get full credit. +This is explained to students alongside their due dates, but it is nevertheless potentially confusing. + +\section{Quizzes/Exams} + +With \WW\ you can create quizzes that students can take online, proctored or not. +You can also use \WW\ to generate quizzes \emph{that are possibly different for each student} and print them off or have them taken at a computer station. +Here is an outline of how to create a quiz/exam. +\begin{enumerate} + \item Create a `homework set' that will become the quiz; give it an appropriate name like Quiz1. + Keep in mind that the set may draw randomly from a ``problem group'', discussed in \hyperref[groups]{Problem Groups}. + (For example, problem number 5 on the exam could be a randomly chosen problem from a list of problems all having to do with solving a linear equation.) + \item In the set details for that set (in the \HSE\ click on the number for that set under the column \menu{Edit Problems}), use a drop down menu to turn the HW assignment into a quiz (either proctored or not) and save changes. + \item Set a bunch of parameters for the quiz that appear, discussed below. + \item If the quiz is proctored, arrange for a computer lab and proctor. + Proctors either enter their own login information into each student's screen one at a time, or they can verbally give a password to all of the students in the room that will let them start. +\end{enumerate} + +To help you understand the multitude of options for a quiz, consider this scenario that an instructor may have put in place. +Some of the chosen options may seem silly, but this example is just for demonstration. + +\hfill\begin{minipage}{0.9\textwidth} + The quiz becomes available on Monday morning at 12:00{\sc am} and the due date is Friday at 11:59{\sc pm}. + Each student is allowed to take up to 3 versions of the quiz. + Each new version will use new random seeds, so the questions will be different. + Once a student starts a version, they have one hour to complete it. + After the due date, an exam may not be started, but had a student started just before the due time, they do have a full hour. + Each time a student is working on a version of the quiz, they may submit it twice for a grade (allowing them to make corrections after the first submission). + In any 24 hour time interval, the student may start at most 2 versions. + Problems are ordered randomly from student to student. + Only three problems at a time are shown on each screen. + Once a student has no remaining attempts or time for a version, they are granted access to their score for that version of the entire quiz. + However, they do not get to see their scores or answers for the individual questions until after the due date. +\end{minipage} + +If you are new to \WW\ Gateway quizzes, I recommend that you try taking your own quiz and experimenting to check that you have all of the options the way you wish them to be. + +\subsection{Problem Groups}\label{groups} + +It is possible to define a collection of related problems, say all having to do with ``section 2. +4'', and then have your quiz pull problems randomly from that set. (Unfortunately this feature is currently only available for \emph{quizzes}, not regular homework assignments.) This is especially useful if you want each student's quiz to be different from their neighbor's. + +This walkthrough explains how to do this for such a problem group. +First, create an `assignment' consisting of all of the problems that you would like to group together. +There is no need to assign this set to anyone. +For an example, suppose we name this set \texttt{section2\_4problems}. + +Now in the assignment that will be the assigned quiz, in the \HSE, click on the number for this assignment in the {\bf Edit Problems} column. +At the bottom, you can ``Add blank problem template to end of homework set''. +If you wish for $n$ problems to be drawn from the list in \texttt{section2\_4problems}, then add $n$ blank slots. +If you want to add more than $20$, you will need to do so in stages. + +Set the {\bf Source File} for each of the blanks to be \texttt{group:section2\_4problems}. +Now set the options for the quiz and assign it to your students. + +\section{Importing and Exporting Assignments}\label{impexp} +\WW\ allows for you to be efficient in managing your courses from term to term. +You can package up details of homework sets and quizzes all at once and then move them to a new course. + +\subsection{Exporting an Assignment}\label{exp} +At the end of the term, you may have put together several assignments and quizzes that you wish to keep for future courses, so that you do not have to build assignments from scratch in the future. +To do this, you can \menu{Export} assignments from the \HSE. +This creates a \texttt{. + def} file containing the list of problems, how many attempts you chose, etc. +If all of your problems came from public libraries and your header files were generic, then this will be enough. +You can use the \FM\ to download the \texttt{. + def} file, and import it later into your new course. +A\texttt{. + def} file is just a plain text file; it would be harmless to open one and you might learn something by seeing its structure. + +If the set used problem files that were local to your course (for example, if you modified a preexisting problem or wrote your own problems) then you must also copy these problem files. +\emph{And} you will need to copy the header (set and hardcopy) files that you were using. \emph{And} you \emph{may} need to copy the contents of your \texttt{macros} folder. +You can do this efficiently by highlighting \begin{itemize} \item all of your problem and header files (\texttt{. + pg}) in the \FM\ (including any directories where you may have placed \texttt{.pg} files) + \item all of the set definition files (\texttt{.def}) that you made + \item the \texttt{macros} folder +\end{itemize} +and selecting \menu{Make Archive}. +You will probably need to \Ctrl-click or Apple-click to select the three sources simultaneously. +This creates a \texttt{. + tgz} file compressing everything you highlighted. +Download this \texttt{. + tgz} file and store it. + +\subsection{Importing Assignments}\label{imp} +If you already have a \texttt{. + def} file in your \FM, you can \menu{Import} it using the \HSE. +At the moment that you import it, you can set an ``earliest date'' and all of the dates from the \texttt{. + def} file will be shifted so that the earliest date corresponds to this. +Otherwise you will need to use the \HSE\ to adjust the dates directly. + +If you are importing a set that you are bringing from an old course, then you need to go into your \FM\ and upload the \texttt{. + def} or \texttt{.tgz} file that is described in \hyperref[exp]{Exporting an Assignment}. \WW\ should unpack the \texttt{.tgz} file automatically when it is uploaded to the \FM, and then delete the \texttt{.tgz} file. + +\subsection{Orientation Assignment}\label{orientation} +There is an orientation that is stored in the file \texttt{setOrientation. + def}. +You most likely need to import the orientation yourself, as described in \hyperref[imp]{Importing Assignments}. +This Orientation tries to address the most common problems that students run into using \WW, and also make them aware of its more helpful features. +I recommend that you assign it for some kind of credit. + +\section{Problems With Problems} +\WW\ problems are often coded with randomization, and sometimes the randomization gets out of hand and causes the problem to break down. +Or the author of the problem may have just made a mistake. +Because \WW\ is open source, these issues are quick to fix. +Or you may just see a problem that you want to modify for other reasons. + +\subsection{Modifying an Existing Problem} + +You may find a problem in one of the problem collections that almost suits your needs, but not quite. +For example, there are problems that ask students to solve inequalities and express the solution using \emph{both} interval notation and set-builder notation. +You might want to use this problem, but remove the set-builder portion. + +To modify a problem, add it to your problem set in the usual way. +Once it is part of an assignment, in the \HSE, click the numerical link under the column \menu{Edit Problems} corresponding to the set in question. +Find the problem that you wish to edit, and click \menu{Edit it}. +A new tab or window will open. + +Now you have been thrown into the world of \WW\ programming, but if you just want to make a simple modification, you should be able to make it without having to learn the PG language. +Be aware that any modifications that you make will not change the library's version of the problem, but instead write a new problem just for you on your local directory. + +You will probably need to make three changes. +\begin{enumerate} + \item You'll want to find the section of the displayed text that you would like to change. + The displayed part of a problem falls between the commands \verb=BEGIN_TEXT= and \verb=END_TEXT=. + Or if it is a newer problem, between \verb=BEGIN_PGML= and \verb=END_PGML=. + Find the part that you want to delete/edit and do so. + + \item If the problem is older and uses \verb=BEGIN_TEXT= and \verb=END_TEXT=, then answer blanks are produced in this same section with the command \verb=ans_rule()=. + You may need to remove or add these. + + \item Scroll down to the bottom of the problem to see where the correct answer is compared with what a student puts into an answer blank. + Usually, the command is something like \verb=ANS($ans->cmp());=, where \verb=$ans= is the variable storing the correct answer. + You may need to remove, edit or add these commands too. + Newer problems that use the \texttt{PGML} environment might declare the answer immediately after the answer blank instead of within an \texttt{ANS} command. +\end{enumerate} +If the problem is newer and uses \verb=BEGIN_PGML= and \verb=END_PGML=, then the fix might actually be so intuitive that you don't need special instruction. +Otherwise, ask for help. + +After you have made your alterations, use the \menu{Update} (for local problems) or \menu{NewVersion} tab (for problems from a Library that you wish to make local) to save them. +If making a new version, be sure to use the \menu{Replace current problem} button as you save. +Make sure the file is saved with a \texttt{. + pg} extension. +Your new and improved version of the problem has replaced the original in the assignment. + +\subsection{Writing Your Own Problems} +If you would like to learn how to write your own problems, contact Chris, Alex, or Carl. +You might get started by going to \url{http://webwork. + maa.org/wiki/Category:Authors}. +To examine code for a problem, find the problem in the \menu{Problem Library} (or an assignment), and click to \menu{Edit it}. +You won't be editing the library's version---you'll be creating a new file on your local directory that can only be seen by you, not other instructors. + +Theoretically, the sky is the limit as far as what can be programmed. +Not only does the Perl basis of the PG language provide for excellent algorithmic programming, but you can incorporate Flash and Java applets if you get real crazy. +Contact someone with experience if you are interested and they will point you in some right directions. + +\subsection{If A Problem Turns Out To Be Truly Bad} +You can delete a problem from an assignment or choose to mark it correct for everyone. +In the \HSE, click the numerical link under the column \menu{Edit Problems} corresponding to the set in question. +Problem by problem, you can take either of these actions. + +\section{When You Receive a Student Email} +Students will ask you for help with problems through \WW's \menu{Email instructor} button. +These emails come with a link to the page from where the student sent the request for help. +Click that link, and you'll be asked to log on to \WW. +You will be logged on as yourself, but (as you will see in the upper right corner of the screen) you will be acting as that student. +This means that you will be seeing things from their perspective, in addition to all the extra menus and commands that instructors have access to. + +A useful tool to help diagnose their problem is to click the \menu{Show Past Answers} button at the bottom of the problem they are having trouble with. +This opens another tab or window where you can see \emph{all} of the attempts they have made thus far. +Most of the time, you can quickly diagnose their issue. + +Write them back quickly and you will really impress them. +However they need to check their actual email---\WW\ itself will not alert them that they have a message from you. +I recommend setting up your email to automatically tag these messages and filter them from your inbox. +For filtering, all these messages have \texttt{[WWfeedback]} in the subject line. +At regular intervals when you feel you have the time and are free from distractions, reply to your students. + +\section{Assessment} +\WW\ provides both formative and summative assessment tools. +\subsection{Scoring} +Use the \menu{Scoring Tools} to compute student grades on assignments. +You may do this as often as you wish, just be sure that you wait until the due date to copy scores into your regular grade book. +Note that when you score a problem set, a \texttt{. + csv} file is created that you can open with Excel. +You may need to delete rows from this \texttt{. + csv} file that correspond to instructors, administrators, and dropped students before you copy and paste into the grade book. + +\subsection{Statistics} +The \menu{Statistics} menu helps you analyze class performance as a whole on assignments and individual problems. +If you are vigilant, you can monitor which problem numbers cause the most issues for students and go over these in class. +This is an excellent formative assessment tool and you may develop a weekly habit of using it to choose a review topic for class. + +\subsection{Student Progress} +View student progress with \menu{Student Progress}. +This shows you how deep into the assignment students are, individually or as a class. +If you suspect too many haven't even started, you can crack the whip. + +\section{Editing Data: Change a Single Student's Scores, Attempts, or Due Dates} +Sometimes you may wish to give students credit for a problem even though WeBWorK wouldn't. +Or you might wish to add extra attempts to a problem for a student. +Or you might want to give one particular student an extension. + +In the \HSE, click the numerical link under the column \menu{Edit Assigned Users} corresponding to the set in question. +Each student has a link to the left to \menu{Edit data} for them. + +\menu{Status} is a number (0 to 1) describing their score on each problem. +You can change that here. +Be sure to click \menu{Save Changes}. + +If you change due dates or attempts for that student, you must \emph{also check the box} next to the field. +Again, be sure to click \menu{Save Changes}. + +\section{`Gamification' of \WW\ with Math Achievements}\label{gamification} + +Some research and a lot of anecdotal evidence suggests that we can improve our students' homework completion rates by adding gaming elements to the assignment. +Users of ALEKS will be familiar with its pie, which is an example of this. + +\subsection{Math Achievements} + +Geoff Goehle from Western Carolina university developed a \WW\ module called Math Achievements to bring gamification to \WW. +If you enable it, then students earn math achievement points alongside the normal points they earn on assignments in two ways. +Firstly, they can earn achievement points for every correct problem they answer in their assignments. +Secondly, when certain achievements are met (like The Early Bird, where a student has 100\% on an assignment within 24 hours of it opening) they get more points and a badge. +Instructors can do what they will with these points---give some kind of extra credit or not. +But as points accrue and tasks are met, students can ``level up'', eventually reaching ``Level 10 Professor''. + +If you enable Achievements, there are two options: \emph{without} items and \emph{with} items. +Achievement items are earned when a student levels up. +They are one-time use items that the students can use to get an edge on their grade, while having a little fun. +The items earned at each level (in default conditions) are \begin{enumerate} \item Lesser Rod of Revelation---Gives a student an automatic 50\% on a single homework problem. + \item Potion of Forgetfulness---Resets the incorrect attempts counter to zero for a single problem. + \item Tunic of Extension---This allows a student to extend the due date of a currently open homework for 24 hours for full credit. + \item Cupcake of Enlargement---Doubles the weight of a single problem on a single homework set. + \item Box of Transmogrification---Allows a student to change the source file of a single problem to that of a different problem on the same homework set. + \item Greater Rod of Revelation---Gives a student an automatic 100\% on a single homework problem. + \item Robe of Longevity---This allows a student to extend the due date of a currently open homework for 48 hours for full credit. + \item Cake of Enlargement---This doubles the weight of all of the problems on a currently open homework assignment. + A student could end up having a 200\% for their grade on one assignment if they use this. + \item Scroll of Resurrection---This reopens any homework set (even a closed one) for an additional 24 hours. + The problem seeds are re-randomized, so the student won't be able to simply write down the answers while the set is closed, then resurrect it and enter them. + \item Greater Tome of Enlightenment---Gives a student an automatic 100\% on every problem in a set. + This is a reward for having been diligent with homework throughout the term and cannot be earned without a lot of achievement points from badges and answering questions. +\end{enumerate} + +\subsection{Using Achievements without items} + +If you would like to use Math Achievements without items, the first thing to do is go into the \menu{Course Configuration}, enable Math Achievements, and set the number of points that students earn for each problem\footnote{The default setup uses 5 points per problem and is based on about 200 problems per term. + You can set the points per problem proportionately. +}. +This will add the \menu{Achievements} tool to all users' tool panels, and the \menu{Achievements Editor} to your instructor tools panel. +In the \menu{Achievements Editor}, import the default achievements (\verb=default_achievements.axp=) and enable whichever ones you like. +Achievements need to be `assigned' to your students. +If you get creative, you can also write your own achievements by using the \menu{Edit Evaluator} link for an existing achievement. + +\subsection{Using Achievements with items} + +If you would like to use Math Achievements with items, the first thing to do is go into the \menu{Course Configuration}, enable Math Achievements \emph{and} Achievement Items, and set the number of points that students earn for each problem\footnote{The default setup uses 5 points per problem and is based on about 200 problems per term. + You can set the points per problem proportionately. +}. +This will add the \menu{Achievements} tool to all users' tool panels, and the \menu{Achievements Editor} to your instructor tools panel. +In the \menu{Achievements Editor}, import the default achievements (\verb=default_achievements_items.axp=) and enable whichever ones you like. +Achievements need to be `assigned' to your students. +If you get creative, you can also write your own achievements by using the \menu{Edit Evaluator} link for an existing achievement. + +\subsection{Challenge Problem Achievements} + +The default achievements that you can import are mostly ready to use immediately. +The exception is the achievements that are classified as \verb=04_challenge= achievements. +Here the idea is to have award badges for completing especially challenging problems. +There are two ways to implement these: \begin{itemize} \item Create a special problem set that has all of the challenge problems that you intend to assign for the term. + If you make the name of this set be \texttt{Challenge}, then these challenge achievements will work immediately. + You can have up to ten problems in it. + For more, you would need to create more achievements by using the \menu{Edit Evaluator} link on the \nth{10} challenge achievement and writing an \nth{11}, etc. + \item Locate the problems in your various problem sets that you would classify as challenge problems, and take note of the names of the sets they are inand what problem number they are within that set. + Then use your \menu{Achievements Editor} to \menu{Edit Evaluator} for the challenge problem achievements. + Where you see code like \begin{verbatim} +my %validproblems = ( + 'Challenge' => { + '1' => 1, } + ); + \end{verbatim} change the code to use the name of the homework set with the challenge problem and the problem number from that set. + For example, if the the challenge problem is number 13 from the set \verb=Section2_4=, you might end up with \begin{verbatim} +my %validproblems = ( + 'Section2_4' => { + '13' => 1, } + ); + \end{verbatim} \end{itemize} + +Of course a third option is to just disable these challenge badges. +And there is no harm in just leaving them as they are if you do not feel any problems that you have assigned are worthy of being called challenge problems. +However, if you have the time and have some challenging problems, it adds a little more fun for your students. + +If you have made edits like this to the challenge achievements, you would want to consider the implications for exporting these changes to a new course in a subsequent term. +Specifically, you would use the \menu{Achievements Editor} to \menu{Export} all of your chosen achievements to a \texttt{. + axp} file. +Then you would want to include the \texttt{achievements\textbackslash} folder during the \hyperref[exp]{export process}. + +\subsection{Assigning Achievements to lately-added students}\label{achievementslateaddstudents} +There may be times when you add students to the class after it has begun; once you have added the students to the class, you will need to assign the Achievements to them as a separate action. +Go to the \menu{Achievement Editor}, and you should see that not all of the users in the class have been assigned the Achievements. +Click on \menu{Assign} and then \menu{Select all}; be sure to keep the drop down box as \texttt{preserve existing data} so as not to erase the existing data of your currently-enrolled students. +Once you have clicked \menu{Take Action! +}, you should see that all of your users have been assigned all of the achievements. + +\section{Show Me Another}\label{SMA} + +Commercial online homework platforms often have a feature where a student can get a step by step solution for the problem they are working on, at the cost of having the problem that they were assigned re-randomized. +\WW's Show Me Another Feature is like this, except that the version of the problem that was originally assigned to the student remains their assigned version, and they can see solutions to the \emph{newly} seeded problem. +It is worth noting that if \WW\ is unable to generate a new version of the problem that is different from the version that is actually assigned, then it will tell the student this, and that this feature is unavailable for this problem. + +There are several checks in place to allow you to customize how this feature is used. +First of all, in the \menu{Course Configuration} you decide what elements of the newly seeded problem the student will have access to. +There are four options, any subset of which can be enabled. +\begin{itemize} + \item Walk-through solutions: if the newly seeded version has a walkthrough solution, then the student will be able to see it. + This is the option that makes SMA a parallel to MyMathLab's Show Me How button. + \item Answers: this is redundant if you have enabled the walkthrough solutions and there is a walkthrough solution. + But otherwise, it let's students see what answer was expected for the newly seeded version. + \item Hints: some \WW\ problems are coded with hints that are revealed depending on a global setting by the instructor and how many attempts the student has used. + With this checked, students have access to the newly seeded version's hints regardless of other settings. + \item Check answers: this gives the student the ability to enter an answer for the newly seeded version and have \WW\ check if it is correct. + This would be most useful if the walk-through solutions and answers have not been enabled. +\end{itemize} + +Personally, I tend to always offer SMA with the Check answers option turned on, and all other elements turned off. +This gives motivated students opportunity for extra practice. +There's nothing wrong with turning on the other options, but it's just not my style. +I \emph{do} turn on all the other options if I am creating a \WW\ course whose purpose is self-study instead of homework. + +The other thing to set in \menu{Course Configuration} is the number of times a student may use \menu{Show Me Another} for each problem. +Maybe you wouldn't care to allow your student to use this button over and over again on any one problem forever. +Personally, I set this to $-1$, which is code for ``there is no limit''. + +Lastly, you very well might like this feature to be enabled for some problems, but not all. +For this reason, in the \menu{Set Details} page for a problem set (accessible through the \HSE, and then clicking on the number of problems within the set), you can set the threshold of attempts that a student must use before the button becomes available to them. +For example, it is set to $2$, then they must attempt the problem twice before the button is available. +If you want the button to be immediately available, set the threshold to $0$. +If you want the button to never never be available for that problem, then convention is to use $-1$. + +\emph{Important:} +If you are importing one of the PCC default homework sets, then every problem's threshold number will be $-1$. +If you want them to be $0$, or $2$, or whatever, it would be extremely tedious to change the threshold manually for each problem. +So \emph{before} you import the problem set(s), go to the \FM, navigate up one folder, and edit the file \texttt{course. + conf}. +Find a blank line anywhere near the bottom and paste the line \begin{center} \verb=$problemDefaults{showMeAnother}=2;= \end{center} or of course use some number other than $2$. +Save, and \emph{then} import your problem sets. +They will all have their SMA threshold set to whatever setting you made. + +\section{Good Ideas to Keep Everything Running Smoothly}\label{goodideas} + +\begin{itemize} + \item Respond as soon as you can to students' requests for assistance. + A fast response rate really improves students' attitudes about using \WW. + Students cite this fast response rate as one of the top two reasons for liking \WW. + (The other is the immediate feedback from \WW\ itself.) + + \item Test the problems that you assign by assigning the homework sets to yourself, and running through all the problems. + Many of the problems are freshly programmed and there are bound to be some mistakes. + Right now the easiest way to handle this is to use the \menu{Email Instructor} button from the offending problem to send yourself a message. + Then forward that email to Alex, Carl, or Chris. + + \item While you do the problems yourself, make note of any special `computer language' that is necessary for completing the set. + For example, that you enter $\pi$ as \texttt{pi}. + Write all this down and include it in the set header. + Mention these items in class too. + + \item Consider giving unlimited attempts to problems. + If the underlying philosophy is that homework is a learning device and not a testing mechanism, then the good that comes from unlimited attempts outweighs the bad. + \begin{itemize} + \item Students are encouraged by the ability to keep trying to solve a problem until they get it right. + + \item There will be some problems where students will swear up and down that they are correct, yet \WW\ marks them incorrect because they `do not know the computer language'. (Sometimes this has merit, but much more often they simply have wrong answers.) They become really upset \emph{if they use up all of their attempts} while completely confident that they are correct. + A negative attitude is more than just a pain for you -- it could reduce the effectiveness of \WW\ as a learning tool. + + \item Suppose that a poorly programmed question escapes your notice during your preview of the assignment. + Suppose that you make the call to alter the problem to fix the issue, as is outlined in a section above. + Suppose that students have \emph{limited} attempts. + By the time you make your changes, several students may have used up all their attempts, and you would need to deal with that. + + \item I find that some proud/too-polite students will not ask for help until they have tried many ($>\!\!10$) attempts. + With limited attempts, these students might just move on after using up their attempts, and never ask for help. + + \end{itemize} + + There will rarely be an opportunity for exhaustive guessing to lead to correct answers. + When a problem does lend itself to exhaustive guessing (e. + g.\ a matching problem), of course that is a good time to limit attempts. + + \item Use the \menu{Statistics} menu to identify which problems are generally causing trouble for your students that you could go over in class. + + \item Use an `attempt threshold' to encourage an email request for help. + For example, you might say ``Email me for help if you are still stuck after five attempts. + '' + + \item Make sure students are aware of the tools they have: + \begin{itemize} + \item The \menu{Email Instructor} button + \item The feedback messages (which students often overlook) + \item Printing hard copies + \item PCC computer access + \item Viewing answers after the answer date + \end{itemize} + The Orientation assignment tries to make them aware of most of these, but redundancy (like mentioning these things every now and then) is helpful. + + \item Give your students a short guide similar to this one, but for students. (I've made one that you are welcome to use or edit.) + + \item If you are using questions that come from a textbook, assign even numbered problems (problems without answers in the back of the book.) Obviously, you don't want a slacker student to just enter the answers from the back. + More importantly, the reasoning behind assigning odd problems is one-upped with \WW. + The purpose of assigning odd problems is so that students can see for themselves when they are incorrect. + \WW\ can do this \emph{without} simultaneously giving away what \emph{is} correct. + + \item If you are using problems that have randomization, encourage students to work together. + They will not be simply able to give each other answers; they will need to communicate process to each other. + This kind of collaborative learning is good for all involved, and the randomization serves as a countermeasure to outright cheating. + +\end{itemize} + +\end{document} + diff --git a/test-cases/oneSentencePerLine/webwork-guidemod1.tex b/test-cases/oneSentencePerLine/webwork-guidemod1.tex new file mode 100644 index 00000000..24dc0487 --- /dev/null +++ b/test-cases/oneSentencePerLine/webwork-guidemod1.tex @@ -0,0 +1,806 @@ +% https://raw.githubusercontent.com/Alex-Jordan/WeBWorKUserGuide/master/WeBWorKUserGuide.tex +% arara: pdflatex +% arara: pdflatex +\documentclass[12pt]{article} + +\usepackage[charter]{mathdesign} % changes font + +\usepackage[margin=2cm]{geometry} +\usepackage{keystroke,dsfont,verbatim} +\usepackage[super]{nth} +\usepackage[colorlinks=true, linkcolor=blue]{hyperref} + +\newcommand{\menu}[1]{\textbf{#1}} +\newcommand{\WW}{WeBWorK} +\newcommand{\HSE}{\menu{Hmwk Sets Editor}} +\newcommand{\FM}{\menu{File Manager}} + +\setlength{\parindent}{0mm} +\setcounter{secnumdepth}{0} + +\title{\WW\ User Guide for PCC Instructors} +\author{Alex Jordan\\\href{mailto:alex.jordan@pcc.edu}{alex.jordan@pcc.edu}} + +\begin{document} + +\maketitle + +This document is meant to serve two purposes. +For PCC faculty who are already familiar with \WW, this is meant to be a reference. +From the table of contents you may hyperlink to any topic. +For PCC faculty who are new to \WW, the document can be used linearly as you set up your course. + +\footnotesize +\setcounter{tocdepth}{2} +\tableofcontents + +\setlength{\parskip}{10pt} + +\newpage +\normalsize + +\section{Overview} + +\WW\ is accessed through a web browser. +Its primary purpose is for your students to submit mathematical answers to homework problems. +It has several other uses including timed exams, placement testing, data-gathering, and general collection of (not necessarily mathematical) student responses. + +You will have access to several libraries of problems, each problem of which is coded in the form of a plain text file. +A \emph{homework set} is a list of problems from these libraries together with a due date and certain other options. +When a homework set has been created, you assign it to your students, or subsets of your students. +\WW\ keeps track of all student input and their scores. +Note that a \emph{homework set} does not need to literally be a homework set. +It could be a review set, an exam, a survey, reading material, etc. + +Your role\footnote{More complicated roles are possible.} is to: \begin{enumerate} \item Add your students to the course and choose some initial configuration settings. + \item Create the problem sets. + I recommend getting this all laid out before the term starts. + It is a one-day investment that will reduce your workload during the term. + You will have complete flexibility to change anything later. + For future versions of the same course, this process is very fast; you can copy an old setup and just change dates. + \item Respond to student emails for help. \WW\ will allow students to email you rather effortlessly for help. + Since the volume of email that this creates can get large, I recommend setting up an email filter to separate any incoming message with [WWfeedback] in the subject header. + When you have time and are in the right mindset to respond to student emails, you can go through this pile more efficiently. + \item Put out occasional fires. + Maybe a student forgets their password. + Maybe you want to grant an extension to an assignment. + Maybe there is a code issue with a problem that you have assigned (in which case you may need to call for help. + ) + \item Gather the grades from \WW\ and import them into your grade book. +\end{enumerate} + +If you are brand new to \WW\, then I suggest progressing in a straight line through this guide. +You will know when it is OK to skip something. +If you have more than one section of a course, then focus on one section first. +You will be able to quickly copy your setup once the first section is in good shape. +If you are not new to \WW\, then consider this document to be a reference guide. + +\section{Logging On and Passwords} + +Unless you have a special case,\footnote{Some special courses may have a different structure to their address.} your course is located at (using all lowercase letters): \begin{center} \href{http://webwork.pcc.edu/webwork2/}{\texttt{http://webwork.pcc.edu/webwork2/aaabbb-ccccc-lastname}}\\ or at\\ \href{http://webwork.pcc.edu/webwork2/}{\texttt{http://webwork.pcc.edu/webwork2/aaabbb-astname-term}} \end{center} where \texttt{aaa} is your subject code (mth, cs, etc. +), \texttt{bbb} is your course number (060, 111, etc.), \texttt{xxxxx} is your CRN, \texttt{lastname} is your last name, and \texttt{term} is something like \texttt{f15}. +You can ask to remove your last name from the CRN-specific address, but having it there can make it easy to find your own courses from among the list at \url{webwork.pcc.edu}. +Make a bookmark with this link at your work station---you will need to come here often. +For your students, you should make a link in MyPCC under the \menu{Links} section. +(Don't make them have to directly type the awkward web address.) It's also possible that your course is listed at \href{http://webwork.pcc.edu/webwork2/}{http://webwork.pcc.edu/webwork2/}, but it may be hidden. + +In most cases, everyone's login should be their complete PCC email prefix, using \emph{all lowercase} letters. +If your email is \texttt{jane.doe15@pcc.edu}, your login should be \texttt{jane.doe15}. +The default password should be your G-number, using \emph{a capital G}. +It might be your old password if you have used \WW\ before. +If you cannot log on, contact \href{mailto:alex.jordan@pcc.edu}{Alex Jordan} (SY) or Carl Yao (SE), each of whom has administrative access to your account. +Everyone (especially instructors and TAs) should change their password the first time that they log in. +This is done using the \menu{Password/Email} item under \WW's main menu. + +\section{Initial Setup} +When you first receive your \WW\ course, there are a few items to initialize. +On the home screen when you log in, you will see \menu{Course Info} off to the right. +You should \menu{[edit]} this, providing all students with some basic course information. +You may use \href{http://en.wikipedia.org/wiki/HTML_element}{html tags} to improve the look of this section or link to other web resources, but that's not necessary. +(This is all stored in your course's \FM\ as \verb=course_info.txt= if you would like to access that file directly.) + +%You can also include a text file (with html if you like) to display information at the login screen. This file should be stored in your \FM\ as \verb=login_info.txt=. The default gives helpful information to students about how to log in. + +Next, there are some options you might want to tend to in the \menu{Course Configuration} menu. +Browse through all five tabs in the \menu{Course Configuration} menu. +All options should be set to something reasonable by default. +If you understand what an option does, feel free to change it. +Of course if you do not understand an option, leave it alone or feel free to ask about it. +The most common items you may want to change settings for are: + +\subsection{Enable Conditional Release} + +If you would like to make it possible to conditionally release homework assignments, you can enable this option. +For example, this can be used to make it so that Assignment \#2 is not available until a student has say a 90\% on Assignment \#1, etc. + +\subsection{Course Achievements} + +\WW\ has a feature called Course Achievements. +This is a way to award achievement points (separate from regular homework points), badges, levels, and special items to students to make the whole experience more like a game. +For many students, this `gamification' of homework is motivational. +If you like, enable Course Achievements in the \menu{Course Configuration} menu. +Once you do this, your navigation panel will have an \menu{Achievements Editor} in the instructor tools. +Also, all users will have an \menu{Achievements} menu to monitor their achievements. +To make use of this feature, you need to import achievements and assign them to your students. +This is discussed in more detail in the \hyperref[gamification]{Gamification} section. + +\subsection{Enabling MathView} + +This is a palette tools that may make it easier for students to enter complicated expressions. +If it is enabled, there will be an icon next to each answer blank. +Clicking this icon will open an applet window that allows students to construct an expression with radicals, fractions, and more using a palette similar to MathType (but with few complications). +MathView is enabled by default. +If a student has a MathView window open, then they can see the ``pretty-print'' version of their answer as they type it. +For example, as they type \texttt{(x+1)/x}, they will see this sequence appear character by character: $$(\qquad(x\qquad(x+\qquad(x+1\qquad(x+1)\qquad\frac{x+1}{}\qquad\frac{x+1}{x}$$ + +\subsection{Reduced Scoring for Late Work} + +Your assignments will each have a due date/time. +If you like, you may allow students to work beyond the due date/time for reduced credit. +If you plan to use this for any homework sets \begin{itemize} \item Enable Reduced Scoring \item Set the Length of Reduced Scoring Period in minutes \item Set the Value of work done in Reduced Scoring Period \end{itemize} Later when you create an assignment, you will \emph{still} need to enable reduced scoring for that particular assignment within the \HSE, since it is possible to have some assignments use reduced scoring and other assignments not use it. +You can \hyperref[reducedcredit]{read about this} in the \hyperref[makeset]{section on creating homework sets}. + +\emph{Warning:} +If you use this feature, there is currently an unfortunate arrangement. +The displayed due date will be the date and time beyond which students cannot submit \emph{any} more answers. +The reduced credit period begins \emph{prior} to this. +\WW\ \emph{does} explain this to students alongside the due date, but this arrangement is potentially confusing. + +\subsection{Show Me Another Button} + +If you enable this feature, then you will have the ability to make it so that a student can see a re-randomized version of a problem. +In the new version, you can make it so the student can see the answer, the walk-through solution (if there is one), the hints (if there are any), and have access to the \menu{Check Answers} button. +You will have the ability to control which problems this applies to. +For more information, see \hyperref[SMA]{the section on Show Me Another}. +This feature is supposed to serve as an analog to a solutions manual or textbook examples. + +If you think you will use this feature, you should go to \hyperref[SMA]{the section on Show Me Another} now and read about it. +There may be some configuration settings that you would want to set \emph{before} you import or build any homework sets. + +\section{Adding/Dropping Students} +In the future, enrollment of students may be automated through Banner. +For now, it falls upon you to enroll students and enter their information. + +\subsection{Adding Many Students at Once} +You may add a full roster of students to your \WW\ course all at once with minimal hassle if you do the following little dance with MyPCC and Excel. +I recommend waiting until the weekend before classes start to follow the procedure below to minimize the hassle that comes with all the flux of enrollments right before a term begins. +The goal is to create a plaintext \texttt{.csv} (comma separated value) file that has all the pertinent information in it. +Each line of the file will have a student's information with no spaces, organized as:\\ + +\small \centerline{\texttt{G-num,L-name,F-name,status,comment,section,recitation,email,login,password,permission}} \normalsize \vspace{1pc} + +If you understand all this so far then you may not need any further instruction. +But more detailed step-by-step instructions follow. +If you have trouble, send \href{mailto:alex.jordan@pcc.edu}{Alex Jordan} your full class roster in the form of the \texttt{.xls} file that you can download from MyPCC. + +\begin{enumerate} + \item In MyPCC, go to your \menu{Summary Class List}. + At the bottom, there is a link to \menu{Download Roster}. + Click on this and open the file with Excel. + \item Delete the first four columns so that G-numbers slide over to column \texttt{A}. + Also delete the top two rows so that the remaining top row is actual student data. + Note that you may have wait-listed students at the bottom. + It's your choice to enroll them in \WW\ or not. + You can always delete them (and any no-show students) later. + \item Highlight column \texttt{C}, and \menu{Insert} columns until the student email addresses are in column \texttt{H}. + This should leave column \texttt{A} with G-numbers, \texttt{B} with names, several blank columns, \texttt{H} with email addresses, and more beyond that. + Clear the contents of all columns beyond the email addresses. + \item Highlight the column of names. + In the \menu{Data} menu, select \menu{Text to Columns}. + Choose the \menu{Delimited} option. + Add \menu{Comma} to the list of delimiters, and click \menu{Finish}. + Column \texttt{B} should now have your students' \emph{last} names, and column \texttt{C} should have their \emph{first} names and middle initials. + \item Fill column \texttt{D} with the letter C. (You can enter a single C at the top of the column and drag it down the column's length.) The C stands for Currently enrolled. + If a student is auditing, an A belongs here instead. + \item Columns \texttt{E} is for a comment about the student. + I usually leave this blank, but make a note if a student is only on a wait list at that point. + Column \texttt{F} is for noting the section. + If there is only one CRN, I leave this blank. + If there are multiple CRNs, I typically enter something like ``42483 TuTh morning'', and this will allow you to sort students by section and assign due dates differently to different sections. + Column \texttt{G} is for recitation. + At PCC, I don't see a need to enter anything here. + But if you did, it would serve the same purpose as the section column, and just allow for multiple ways to sort. + \item Copy column \texttt{H} (which should still have email addresses) to column \texttt{I}. + Highlight column \texttt{I} and add the @ symbol to the list of delimiters by once again using \menu{Data}$\rightarrow$\menu{Text to Columns}. + Clear all the \texttt{pcc.edu}s from column \texttt{J}. + Now column \texttt{H} should \emph{still} have email addresses, and column \texttt{I} should have their user logins. + \item Leave column \texttt{J} blank. (This is where you could use a password hash from some earlier course. + Leaving it blanks makes it so their student ID (G number) will be their initial password. + Fill column \texttt{K} with the number 0. + (This sets their permission level to \texttt{student} as opposed to say \texttt{professor}.) + \item Save the Excel document as a \texttt{.csv} file. + Excel may give you warnings as you do this about losing data, but don't worry. +\end{enumerate} + +If you are putting multiple CRNs into one \WW\ course, then you can either repeat this process for each CRN, or you can make one big CSV file with all the courses. +Just remember to distinguish the students by section using the section column. + +Your \texttt{.csv} file needs to be renamed to have a \texttt{.lst} (that's $\ell$\texttt{st}, not $1$\texttt{st}) extension. +If you have trouble doing that in your operating system, you can also rename the file within \WW. +Use \WW's \menu{File Manager} to upload your \texttt{.lst} file straight to the \texttt{templates} directory. +Check that it really does have the \texttt{.lst} extension (and if not, use the \menu{Rename} tool). +Then in the \menu{Classlist Editor}, use \menu{Import users from file} to add all of these students to your \WW\ course. +If any problem sets have already been created or imported, then you should now assign them to all of these new students by using the \menu{Instructor Tools}. + +\subsection{Adding Students One (or a Small Number) at a Time} +In the \menu{Classlist Editor} there is a tab for adding students by hand. +Fill in as much information as you can, but the minimum that is needed is a \menu{Login Name}, a \menu{Student ID}, and an \menu{Email Address}. +Initial passwords will be the \menu{Student ID}s. +As you individually add students this way, you may choose existing assignments to assign to these new students, or you can do this later using \menu{Instructor Tools}. + +If you are using the Achievements in your class, be sure to assign achievements to these newly-added users---see \hyperref[achievementslateaddstudents]{the section on assigning achievements to lately-added students}. + +\subsection{The Orientation Assignment} +There is an Orientation assignment for your students to take. +\footnote{If you are not using \WW\ as a homework platform, there is probably no need for this.} +This orientation tries to address common issues that students have when using \WW. +Once you have your students enrolled, import the Orientation assignment by following the instructions in the \hyperref[orientation]{Orientation section}. +Or if you are progressing through this document linearly, you can wait until you get there. +\emph{Be sure to actually assign the Orientation to all students.} +Simply importing the Orientation is not enough. + +\subsection{Removing Students} +\emph{Before the course begins}, you may remove students by deleting them in the \menu{Classlist Editor}. +After a course has begun, it is strongly recommended that you \emph{drop} them, instead of \emph{deleting} them. +To \emph{drop} a student, select their checkbox from the \menu{Classlist Editor} and \menu{Edit selected users}. +Change their status. +By dropping rather than deleting, the student's data is preserved, just in case it is needed. + +\subsection{Guest Accounts} +You can set up your course so that guests may log in. +Guests may view problems from homework sets that have been assigned to the guest IDs. +Their data is not stored. +If the due date has not yet passed, guests may \emph{not} check their answers for correctness. +If you would like to have guest accounts enabled, go to the \menu{Classlist Editor} and import users from the file \texttt{demoCourse.lst}. +This creates ``students'' in your course list named practice1, practice2,\ldots,practice9. +If such a ``student'' is part of your roster, then the login screen will have a \menu{Guest} login button. +If you later wish to disable guest accounts, simply delete these ``students'' from the roster. + +\section{Making a New Problem Set}\label{makeset} +Problem sets can either be imported from an earlier course or made from scratch. +If your course came with problem sets that you would like to import\footnote{Of course, these may have an ordering that is not in line with your syllabus. + Still, they are sets of vetted problems. + So it might be worth importing them and learning how to modify these sets to meet your own needs.}, you may wish to skip ahead to the \hyperref[imp]{section on importing assignments}. +Brand new users teaching MTH 8/20/60/61/62/63/65/70/95/111/243 should skip ahead and import the default assignments that are available (and then modify them if that is desired). +If you have run this course before and wish to copy your old problem sets, you should skip ahead to the \hyperref[exp]{section on exporting assignments}. + +To create a new problem set from scratch, in the \HSE\ or the \menu{Library Browser}, you may \menu{Create} a new set and name it whatever you would like, just no periods or weird characters. +You \emph{can} use spaces though For example, \texttt{Assignment 1} or \texttt{Chapter 3 Review} are good names. + +\subsection{Add Problems} +To add problems to an assignment, go into the \menu{Library Browser}. +Select the \menu{Target Set} from the dropdown menu. +There are several sources of problems for you to browse. + +\begin{description} + \item{For MTH 60--70} select the \menu{Basic Algebra} library. + From the \menu{Select a Problem Collection} drop-down menu, choose the relevant topic. + These problems were written by Chris Hughes, Alex Jordan, and Carl Yao during summer 2013. + Each problem has a walk-through solution, uses high-quality \WW\ coding techniques, and was written with accessibility standards in mind. + + \item{For MTH 20} select the \menu{Basic Math} library. + These problems were coded by Carl Yao mostly over Fall 2013. + Each problem has a walk-through solution, uses high-quality \WW\ coding techniques, and was written with accessibility standards in mind. + + \item{For MTH 111} select the \menu{College Algebra} library. + These problems were coded by Alex Jordan mostly over Summer 2014. + Each problem has a walk-through solution, uses high-quality \WW\ coding techniques, and was written with accessibility standards in mind. + + \item{For MTH 95} select the \menu{Math 95} library. + These problems are generally not from a textbook and use randomization. + These problems are currently being improved upon to reach the same standards as the 60/65 problems. + MTH 95 overlaps some with MTH 60/65, and you will find usable problems in the Precollege Algebra library too. + During Fall 2015, Carl Yao and Heiko Spoddeck will work to improve the quality of the MTH 95 problems. + + \item{For MTH 243} select the \menu{Statistics} library. + These problems are generally not from a textbook and use randomization. + These problems are currently being improved upon to reach the same standards as the 60/65 problems. + + \item{For physics problems} take a look in the \menu{CAPA} library. + CAPA is an older online homework platform for physics problems, and some time ago an automated process converted CAPA problems to a state where \WW\ can use them. + These problems do not necessarily use the best coding techniques, and they often come with pictures that currently do not have good alt tags for accessibility. + + \item{For \emph{any} course,} you may look for problems in the \menu{Open Problem Library}, formerly known as the \menu{National Problem Library}. + These are sortable with a simple search or the \menu{Advanced Search}. + Lastly try looking at the \menu{OPL Directory}, which organizes the OPL library according to who contributed the problems and what their indexing system was. + The problems from Union College and the College of Idaho are notably well-written, but there are many institutions that have written good problems. +\end{description} + +Click \menu{View Problems} to see the problems. +The default is to see 20 at a time, but you can change this. +You can click the re-randomize icon for each problem to see how its randomization behaves. +Use the \menu{Add} button to add problems to the problem set you have targeted. + +\subsection{Set Description} +In the \HSE, after clicking in the numerical link for your set under \menu{Edit Problems}, there is a field to give a brief description of the set. +When users hover their mouse over the name of the problem set, this description appears as a tooltip. +For example, you could \emph{name} a homework set as \emph{Chapter20}, and give it a \emph{description} that is a little more detailed, like \emph{Hypothesis Testing for Population Proportions}. + +\subsection{Assign the Set to Students} +Use the \menu{Instructor Tools} to assign the set to students. +At first, the problem set will have an opening date in the future, so there is no concern that students will log on and begin working before you have completed the setup. +Of course, if you have not yet enrolled your students, you will need to come back to do this later. + +\subsection{Do the Assignment Yourself} +This isn't really necessary. +However, it is a good idea. +This way, you will encounter issues before your students do. +(If you find an issue with a problem, you can edit it, replace it with one that works, or ask someone who knows the \WW\ programming language to look into it.) + +Take notes concerning any input issues the problems have. +Will students need to be reminded how to enter $\pi$ or $\infty$? +Will they need to know that they should answer in function notation, as with $P(t)=1. + 1^t$ rather than just $1.1^t$? +Well-written problems will make these issues clear. +Take notes on issues like this that you come across and you can put them into the assignment header later. + +\subsection{Set Attempts} +By default, \WW\ will allow students unlimited attempts for each problem (while keeping track of how many tries a student uses and recording their incorrect answers). +In the \HSE, click the numerical link under the column \menu{Edit Problems} corresponding to the set in question. +You probably want to change the \menu{Display Mode} for the \menu{Problems} to \menu{MathJax} or \menu{Images}, and then click \menu{Refresh Display}. +Problem by problem, you may change the number of allowed attempts. + +For multiple choice questions, you may only want to allow one or two attempts. +For matching questions, maybe more. +I recommend allowing unlimited attempts for all other problems. +Reasons for this are discussed below in the \hyperref[goodideas]{Good Ideas section}. + +\subsection{Set Show Me Another Threshold} +If you have enabled the Show Me Another feature, then for each problem you can indicate how many attempts a student must use before they gain access to the \menu{Show Me Another} button. +Setting this to $0$ will give students immediate access to the \menu{SMA} button for that problem. +Setting this to $-1$ is the default, and this means that the student will never have access to the button. + +\subsection{Assignment Header} +When a student opens an assignment, they see some text off to the right. +The intent is to give information to the student that are specific to that assignment. +You can tell students which chapters from the book are relevant, give links to places on the Internet, give tips on entering answers, etc. +If you do nothing, then some default text will appear here. +Best practice is to replace this text with your own instructions and warnings. + +Unfortunately, the source file that is used to print these messages is written in the language that \WW\ uses for generating problems, which is a combination of Perl, \LaTeX, and \WW-specific elements. +For the uninitiated, writing this section from scratch would be difficult. + +Your \FM\ has a file called \texttt{ASimpleScreenHeaderFile.pg}. +In the \HSE, click the numerical link under the column \menu{Edit Problems} corresponding to the set in question. +In the big \menu{Headers} box, use the drop-down menu to select \texttt{ASimpleScreenHeaderFile.pg}. +You should then \menu{Edit it} to make it relevant to the assignment you just created. +After you have made your alterations, use the \menu{New Version} tab to save the file with a new name, and be sure to check the radio button that replaces the set's header file. +Now students will see this nice header when they open this assignment. + +One advantage of exporting and importing old assignments is that you don't generally repeat the process of setting up header files---you just reuse your old header files. + +\subsection{Hardcopy Header} + +A large number of students will put their assignments into \texttt{.pdf} files, to work with offline, and then return to enter answers later. +A \emph{different} header file called the \emph{hardcopy header} is used for printed versions. +The lazy thing to do is to use the same screen set header that you just made. +For technical reasons, this is not ideal. +Formatting will be off---a minor concern. +Somewhat more importantly, the characters $<$, $>$, $\{$, and $\}$ will not show up correctly. +Even worse things may happen if you were using characters like \$, \^{}, \textunderscore, \%, etc. + +If you want to do things right, set the hardcopy header to \texttt{ASimpleHardCopyHeaderFile.pg} and then edit it in a similar way to how you created the screen header file. +(Or you can just use your header as a hardcopy header and \emph{probably} nothing serious will go wrong.) + +\subsection{Set the Dates} +In the \HSE, \menu{Edit} the set that you just put together. +You may set the date that the problem set is available to students, the date that it is due, and the date that answers are made available to students. + +Be careful with setting the due time. +It is tempting to use midnight, but don't use 12:00{\sc am}, since many students will confuse this with noon. +Also, if you set a due time to 11:59{\sc pm} Tuesday in the fall, then the daylight savings changeover will make the due date become 12:59{\sc am} Wednesday, and some students will erroneously think that the assignment is due Wednesday at midnight. +One last consideration---as a due date/time approaches, many students will log on. +If this simultaneously happens across many courses, it has the potential to overload the server. +For that reason, consider setting a due date/time that is in the middle of a weekday, when tech support is still available to get the server back up. + +I recommend that you set the \menu{answer date} (when answers and solutions become visible to students) to one or two days after the \menu{due date}. +This is because you may want to grant an extension the day after an assignment was originally due, and you would not want the answers to have been made available in the meantime. + +Default due times and time lags between the three critical times for an assignment may be set in the \menu{Course Configuration}. + +\subsection{Reduced Credit Period}\label{reducedcredit} + +If you like, you may set a time period at the end of an assignment's window in which students only receive partial credit. +The idea is that you really have an earlier due date in mind, but you are granting a penalized grace period for late submissions. +If you plan to use this, go into the \menu{Course Configuration} and set both the duration of the reduced credit period, and the fraction at which you will offer reduced credit. +You will then need to enable the reduced credit period for that particular assignment within the \HSE. +\emph{Warning:} +If say the due date is set to Friday and you set a 24 hour reduced credit period, then students will see a due date of Friday but only have until \emph{Thursday} to get full credit. +This is explained to students alongside their due dates, but it is nevertheless potentially confusing. + +\section{Quizzes/Exams} + +With \WW\ you can create quizzes that students can take online, proctored or not. +You can also use \WW\ to generate quizzes \emph{that are possibly different for each student} and print them off or have them taken at a computer station. +Here is an outline of how to create a quiz/exam. +\begin{enumerate} + \item Create a `homework set' that will become the quiz; give it an appropriate name like Quiz1. + Keep in mind that the set may draw randomly from a ``problem group'', discussed in \hyperref[groups]{Problem Groups}. + (For example, problem number 5 on the exam could be a randomly chosen problem from a list of problems all having to do with solving a linear equation.) + \item In the set details for that set (in the \HSE\ click on the number for that set under the column \menu{Edit Problems}), use a drop down menu to turn the HW assignment into a quiz (either proctored or not) and save changes. + \item Set a bunch of parameters for the quiz that appear, discussed below. + \item If the quiz is proctored, arrange for a computer lab and proctor. + Proctors either enter their own login information into each student's screen one at a time, or they can verbally give a password to all of the students in the room that will let them start. +\end{enumerate} + +To help you understand the multitude of options for a quiz, consider this scenario that an instructor may have put in place. +Some of the chosen options may seem silly, but this example is just for demonstration. + +\hfill\begin{minipage}{0.9\textwidth} + The quiz becomes available on Monday morning at 12:00{\sc am} and the due date is Friday at 11:59{\sc pm}. + Each student is allowed to take up to 3 versions of the quiz. + Each new version will use new random seeds, so the questions will be different. + Once a student starts a version, they have one hour to complete it. + After the due date, an exam may not be started, but had a student started just before the due time, they do have a full hour. + Each time a student is working on a version of the quiz, they may submit it twice for a grade (allowing them to make corrections after the first submission). + In any 24 hour time interval, the student may start at most 2 versions. + Problems are ordered randomly from student to student. + Only three problems at a time are shown on each screen. + Once a student has no remaining attempts or time for a version, they are granted access to their score for that version of the entire quiz. + However, they do not get to see their scores or answers for the individual questions until after the due date. +\end{minipage} + +If you are new to \WW\ Gateway quizzes, I recommend that you try taking your own quiz and experimenting to check that you have all of the options the way you wish them to be. + +\subsection{Problem Groups}\label{groups} + +It is possible to define a collection of related problems, say all having to do with ``section 2. +4'', and then have your quiz pull problems randomly from that set. (Unfortunately this feature is currently only available for \emph{quizzes}, not regular homework assignments.) This is especially useful if you want each student's quiz to be different from their neighbor's. + +This walkthrough explains how to do this for such a problem group. +First, create an `assignment' consisting of all of the problems that you would like to group together. +There is no need to assign this set to anyone. +For an example, suppose we name this set \texttt{section2\_4problems}. + +Now in the assignment that will be the assigned quiz, in the \HSE, click on the number for this assignment in the {\bf Edit Problems} column. +At the bottom, you can ``Add blank problem template to end of homework set''. +If you wish for $n$ problems to be drawn from the list in \texttt{section2\_4problems}, then add $n$ blank slots. +If you want to add more than $20$, you will need to do so in stages. + +Set the {\bf Source File} for each of the blanks to be \texttt{group:section2\_4problems}. +Now set the options for the quiz and assign it to your students. + +\section{Importing and Exporting Assignments}\label{impexp} +\WW\ allows for you to be efficient in managing your courses from term to term. +You can package up details of homework sets and quizzes all at once and then move them to a new course. + +\subsection{Exporting an Assignment}\label{exp} +At the end of the term, you may have put together several assignments and quizzes that you wish to keep for future courses, so that you do not have to build assignments from scratch in the future. +To do this, you can \menu{Export} assignments from the \HSE. +This creates a \texttt{.def} file containing the list of problems, how many attempts you chose, etc. +If all of your problems came from public libraries and your header files were generic, then this will be enough. +You can use the \FM\ to download the \texttt{.def} file, and import it later into your new course. +A\texttt{.def} file is just a plain text file; it would be harmless to open one and you might learn something by seeing its structure. + +If the set used problem files that were local to your course (for example, if you modified a preexisting problem or wrote your own problems) then you must also copy these problem files. +\emph{And} you will need to copy the header (set and hardcopy) files that you were using. \emph{And} you \emph{may} need to copy the contents of your \texttt{macros} folder. +You can do this efficiently by highlighting \begin{itemize} \item all of your problem and header files (\texttt{.pg}) in the \FM\ (including any directories where you may have placed \texttt{.pg} files) \item all of the set definition files (\texttt{.def}) that you made \item the \texttt{macros} folder \end{itemize} and selecting \menu{Make Archive}. +You will probably need to \Ctrl-click or Apple-click to select the three sources simultaneously. +This creates a \texttt{.tgz} file compressing everything you highlighted. +Download this \texttt{.tgz} file and store it. + +\subsection{Importing Assignments}\label{imp} +If you already have a \texttt{.def} file in your \FM, you can \menu{Import} it using the \HSE. +At the moment that you import it, you can set an ``earliest date'' and all of the dates from the \texttt{.def} file will be shifted so that the earliest date corresponds to this. +Otherwise you will need to use the \HSE\ to adjust the dates directly. + +If you are importing a set that you are bringing from an old course, then you need to go into your \FM\ and upload the \texttt{.def} or \texttt{.tgz} file that is described in \hyperref[exp]{Exporting an Assignment}. +\WW\ should unpack the \texttt{.tgz} file automatically when it is uploaded to the \FM, and then delete the \texttt{.tgz} file. + +\subsection{Orientation Assignment}\label{orientation} +There is an orientation that is stored in the file \texttt{setOrientation.def}. +You most likely need to import the orientation yourself, as described in \hyperref[imp]{Importing Assignments}. +This Orientation tries to address the most common problems that students run into using \WW, and also make them aware of its more helpful features. +I recommend that you assign it for some kind of credit. + +\section{Problems With Problems} +\WW\ problems are often coded with randomization, and sometimes the randomization gets out of hand and causes the problem to break down. +Or the author of the problem may have just made a mistake. +Because \WW\ is open source, these issues are quick to fix. +Or you may just see a problem that you want to modify for other reasons. + +\subsection{Modifying an Existing Problem} + +You may find a problem in one of the problem collections that almost suits your needs, but not quite. +For example, there are problems that ask students to solve inequalities and express the solution using \emph{both} interval notation and set-builder notation. +You might want to use this problem, but remove the set-builder portion. + +To modify a problem, add it to your problem set in the usual way. +Once it is part of an assignment, in the \HSE, click the numerical link under the column \menu{Edit Problems} corresponding to the set in question. +Find the problem that you wish to edit, and click \menu{Edit it}. +A new tab or window will open. + +Now you have been thrown into the world of \WW\ programming, but if you just want to make a simple modification, you should be able to make it without having to learn the PG language. +Be aware that any modifications that you make will not change the library's version of the problem, but instead write a new problem just for you on your local directory. + +You will probably need to make three changes. +\begin{enumerate} + \item You'll want to find the section of the displayed text that you would like to change. + The displayed part of a problem falls between the commands \verb=BEGIN_TEXT= and \verb=END_TEXT=. + Or if it is a newer problem, between \verb=BEGIN_PGML= and \verb=END_PGML=. + Find the part that you want to delete/edit and do so. + + \item If the problem is older and uses \verb=BEGIN_TEXT= and \verb=END_TEXT=, then answer blanks are produced in this same section with the command \verb=ans_rule()=. + You may need to remove or add these. + + \item Scroll down to the bottom of the problem to see where the correct answer is compared with what a student puts into an answer blank. + Usually, the command is something like \verb=ANS($ans->cmp());=, where \verb=$ans= is the variable storing the correct answer. + You may need to remove, edit or add these commands too. + Newer problems that use the \texttt{PGML} environment might declare the answer immediately after the answer blank instead of within an \texttt{ANS} command. +\end{enumerate} +If the problem is newer and uses \verb=BEGIN_PGML= and \verb=END_PGML=, then the fix might actually be so intuitive that you don't need special instruction. +Otherwise, ask for help. + +After you have made your alterations, use the \menu{Update} (for local problems) or \menu{NewVersion} tab (for problems from a Library that you wish to make local) to save them. +If making a new version, be sure to use the \menu{Replace current problem} button as you save. +Make sure the file is saved with a \texttt{.pg} extension. +Your new and improved version of the problem has replaced the original in the assignment. + +\subsection{Writing Your Own Problems} +If you would like to learn how to write your own problems, contact Chris, Alex, or Carl. +You might get started by going to \url{http://webwork.maa.org/wiki/Category:Authors}. +To examine code for a problem, find the problem in the \menu{Problem Library} (or an assignment), and click to \menu{Edit it}. +You won't be editing the library's version---you'll be creating a new file on your local directory that can only be seen by you, not other instructors. + +Theoretically, the sky is the limit as far as what can be programmed. +Not only does the Perl basis of the PG language provide for excellent algorithmic programming, but you can incorporate Flash and Java applets if you get real crazy. +Contact someone with experience if you are interested and they will point you in some right directions. + +\subsection{If A Problem Turns Out To Be Truly Bad} +You can delete a problem from an assignment or choose to mark it correct for everyone. +In the \HSE, click the numerical link under the column \menu{Edit Problems} corresponding to the set in question. +Problem by problem, you can take either of these actions. + +\section{When You Receive a Student Email} +Students will ask you for help with problems through \WW's \menu{Email instructor} button. +These emails come with a link to the page from where the student sent the request for help. +Click that link, and you'll be asked to log on to \WW. +You will be logged on as yourself, but (as you will see in the upper right corner of the screen) you will be acting as that student. +This means that you will be seeing things from their perspective, in addition to all the extra menus and commands that instructors have access to. + +A useful tool to help diagnose their problem is to click the \menu{Show Past Answers} button at the bottom of the problem they are having trouble with. +This opens another tab or window where you can see \emph{all} of the attempts they have made thus far. +Most of the time, you can quickly diagnose their issue. + +Write them back quickly and you will really impress them. +However they need to check their actual email---\WW\ itself will not alert them that they have a message from you. +I recommend setting up your email to automatically tag these messages and filter them from your inbox. +For filtering, all these messages have \texttt{[WWfeedback]} in the subject line. +At regular intervals when you feel you have the time and are free from distractions, reply to your students. + +\section{Assessment} +\WW\ provides both formative and summative assessment tools. +\subsection{Scoring} +Use the \menu{Scoring Tools} to compute student grades on assignments. +You may do this as often as you wish, just be sure that you wait until the due date to copy scores into your regular grade book. +Note that when you score a problem set, a \texttt{.csv} file is created that you can open with Excel. +You may need to delete rows from this \texttt{.csv} file that correspond to instructors, administrators, and dropped students before you copy and paste into the grade book. + +\subsection{Statistics} +The \menu{Statistics} menu helps you analyze class performance as a whole on assignments and individual problems. +If you are vigilant, you can monitor which problem numbers cause the most issues for students and go over these in class. +This is an excellent formative assessment tool and you may develop a weekly habit of using it to choose a review topic for class. + +\subsection{Student Progress} +View student progress with \menu{Student Progress}. +This shows you how deep into the assignment students are, individually or as a class. +If you suspect too many haven't even started, you can crack the whip. + +\section{Editing Data: Change a Single Student's Scores, Attempts, or Due Dates} +Sometimes you may wish to give students credit for a problem even though WeBWorK wouldn't. +Or you might wish to add extra attempts to a problem for a student. +Or you might want to give one particular student an extension. + +In the \HSE, click the numerical link under the column \menu{Edit Assigned Users} corresponding to the set in question. +Each student has a link to the left to \menu{Edit data} for them. + +\menu{Status} is a number (0 to 1) describing their score on each problem. +You can change that here. +Be sure to click \menu{Save Changes}. + +If you change due dates or attempts for that student, you must \emph{also check the box} next to the field. +Again, be sure to click \menu{Save Changes}. + +\section{`Gamification' of \WW\ with Math Achievements}\label{gamification} + +Some research and a lot of anecdotal evidence suggests that we can improve our students' homework completion rates by adding gaming elements to the assignment. +Users of ALEKS will be familiar with its pie, which is an example of this. + +\subsection{Math Achievements} + +Geoff Goehle from Western Carolina university developed a \WW\ module called Math Achievements to bring gamification to \WW. +If you enable it, then students earn math achievement points alongside the normal points they earn on assignments in two ways. +Firstly, they can earn achievement points for every correct problem they answer in their assignments. +Secondly, when certain achievements are met (like The Early Bird, where a student has 100\% on an assignment within 24 hours of it opening) they get more points and a badge. +Instructors can do what they will with these points---give some kind of extra credit or not. +But as points accrue and tasks are met, students can ``level up'', eventually reaching ``Level 10 Professor''. + +If you enable Achievements, there are two options: \emph{without} items and \emph{with} items. +Achievement items are earned when a student levels up. +They are one-time use items that the students can use to get an edge on their grade, while having a little fun. +The items earned at each level (in default conditions) are \begin{enumerate} \item Lesser Rod of Revelation---Gives a student an automatic 50\% on a single homework problem. + \item Potion of Forgetfulness---Resets the incorrect attempts counter to zero for a single problem. + \item Tunic of Extension---This allows a student to extend the due date of a currently open homework for 24 hours for full credit. + \item Cupcake of Enlargement---Doubles the weight of a single problem on a single homework set. + \item Box of Transmogrification---Allows a student to change the source file of a single problem to that of a different problem on the same homework set. + \item Greater Rod of Revelation---Gives a student an automatic 100\% on a single homework problem. + \item Robe of Longevity---This allows a student to extend the due date of a currently open homework for 48 hours for full credit. + \item Cake of Enlargement---This doubles the weight of all of the problems on a currently open homework assignment. + A student could end up having a 200\% for their grade on one assignment if they use this. + \item Scroll of Resurrection---This reopens any homework set (even a closed one) for an additional 24 hours. + The problem seeds are re-randomized, so the student won't be able to simply write down the answers while the set is closed, then resurrect it and enter them. + \item Greater Tome of Enlightenment---Gives a student an automatic 100\% on every problem in a set. + This is a reward for having been diligent with homework throughout the term and cannot be earned without a lot of achievement points from badges and answering questions. +\end{enumerate} + +\subsection{Using Achievements without items} + +If you would like to use Math Achievements without items, the first thing to do is go into the \menu{Course Configuration}, enable Math Achievements, and set the number of points that students earn for each problem\footnote{The default setup uses 5 points per problem and is based on about 200 problems per term. + You can set the points per problem proportionately.}. +This will add the \menu{Achievements} tool to all users' tool panels, and the \menu{Achievements Editor} to your instructor tools panel. +In the \menu{Achievements Editor}, import the default achievements (\verb=default_achievements.axp=) and enable whichever ones you like. +Achievements need to be `assigned' to your students. +If you get creative, you can also write your own achievements by using the \menu{Edit Evaluator} link for an existing achievement. + +\subsection{Using Achievements with items} + +If you would like to use Math Achievements with items, the first thing to do is go into the \menu{Course Configuration}, enable Math Achievements \emph{and} Achievement Items, and set the number of points that students earn for each problem\footnote{The default setup uses 5 points per problem and is based on about 200 problems per term. + You can set the points per problem proportionately.}. +This will add the \menu{Achievements} tool to all users' tool panels, and the \menu{Achievements Editor} to your instructor tools panel. +In the \menu{Achievements Editor}, import the default achievements (\verb=default_achievements_items.axp=) and enable whichever ones you like. +Achievements need to be `assigned' to your students. +If you get creative, you can also write your own achievements by using the \menu{Edit Evaluator} link for an existing achievement. + +\subsection{Challenge Problem Achievements} + +The default achievements that you can import are mostly ready to use immediately. +The exception is the achievements that are classified as \verb=04_challenge= achievements. +Here the idea is to have award badges for completing especially challenging problems. +There are two ways to implement these: \begin{itemize} \item Create a special problem set that has all of the challenge problems that you intend to assign for the term. + If you make the name of this set be \texttt{Challenge}, then these challenge achievements will work immediately. + You can have up to ten problems in it. + For more, you would need to create more achievements by using the \menu{Edit Evaluator} link on the \nth{10} challenge achievement and writing an \nth{11}, etc. + \item Locate the problems in your various problem sets that you would classify as challenge problems, and take note of the names of the sets they are inand what problem number they are within that set. + Then use your \menu{Achievements Editor} to \menu{Edit Evaluator} for the challenge problem achievements. + Where you see code like \begin{verbatim} +my %validproblems = ( + 'Challenge' => { + '1' => 1, } + ); + \end{verbatim} change the code to use the name of the homework set with the challenge problem and the problem number from that set. + For example, if the the challenge problem is number 13 from the set \verb=Section2_4=, you might end up with \begin{verbatim} +my %validproblems = ( + 'Section2_4' => { + '13' => 1, } + ); + \end{verbatim} \end{itemize} + +Of course a third option is to just disable these challenge badges. +And there is no harm in just leaving them as they are if you do not feel any problems that you have assigned are worthy of being called challenge problems. +However, if you have the time and have some challenging problems, it adds a little more fun for your students. + +If you have made edits like this to the challenge achievements, you would want to consider the implications for exporting these changes to a new course in a subsequent term. +Specifically, you would use the \menu{Achievements Editor} to \menu{Export} all of your chosen achievements to a \texttt{.axp} file. +Then you would want to include the \texttt{achievements\textbackslash} folder during the \hyperref[exp]{export process}. + +\subsection{Assigning Achievements to lately-added students}\label{achievementslateaddstudents} +There may be times when you add students to the class after it has begun; once you have added the students to the class, you will need to assign the Achievements to them as a separate action. +Go to the \menu{Achievement Editor}, and you should see that not all of the users in the class have been assigned the Achievements. +Click on \menu{Assign} and then \menu{Select all}; be sure to keep the drop down box as \texttt{preserve existing data} so as not to erase the existing data of your currently-enrolled students. +Once you have clicked \menu{Take Action! +}, you should see that all of your users have been assigned all of the achievements. + +\section{Show Me Another}\label{SMA} + +Commercial online homework platforms often have a feature where a student can get a step by step solution for the problem they are working on, at the cost of having the problem that they were assigned re-randomized. +\WW's Show Me Another Feature is like this, except that the version of the problem that was originally assigned to the student remains their assigned version, and they can see solutions to the \emph{newly} seeded problem. +It is worth noting that if \WW\ is unable to generate a new version of the problem that is different from the version that is actually assigned, then it will tell the student this, and that this feature is unavailable for this problem. + +There are several checks in place to allow you to customize how this feature is used. +First of all, in the \menu{Course Configuration} you decide what elements of the newly seeded problem the student will have access to. +There are four options, any subset of which can be enabled. +\begin{itemize} + \item Walk-through solutions: if the newly seeded version has a walkthrough solution, then the student will be able to see it. + This is the option that makes SMA a parallel to MyMathLab's Show Me How button. + \item Answers: this is redundant if you have enabled the walkthrough solutions and there is a walkthrough solution. + But otherwise, it let's students see what answer was expected for the newly seeded version. + \item Hints: some \WW\ problems are coded with hints that are revealed depending on a global setting by the instructor and how many attempts the student has used. + With this checked, students have access to the newly seeded version's hints regardless of other settings. + \item Check answers: this gives the student the ability to enter an answer for the newly seeded version and have \WW\ check if it is correct. + This would be most useful if the walk-through solutions and answers have not been enabled. +\end{itemize} + +Personally, I tend to always offer SMA with the Check answers option turned on, and all other elements turned off. +This gives motivated students opportunity for extra practice. +There's nothing wrong with turning on the other options, but it's just not my style. +I \emph{do} turn on all the other options if I am creating a \WW\ course whose purpose is self-study instead of homework. + +The other thing to set in \menu{Course Configuration} is the number of times a student may use \menu{Show Me Another} for each problem. +Maybe you wouldn't care to allow your student to use this button over and over again on any one problem forever. +Personally, I set this to $-1$, which is code for ``there is no limit''. + +Lastly, you very well might like this feature to be enabled for some problems, but not all. +For this reason, in the \menu{Set Details} page for a problem set (accessible through the \HSE, and then clicking on the number of problems within the set), you can set the threshold of attempts that a student must use before the button becomes available to them. +For example, it is set to $2$, then they must attempt the problem twice before the button is available. +If you want the button to be immediately available, set the threshold to $0$. +If you want the button to never never be available for that problem, then convention is to use $-1$. + +\emph{Important:} +If you are importing one of the PCC default homework sets, then every problem's threshold number will be $-1$. +If you want them to be $0$, or $2$, or whatever, it would be extremely tedious to change the threshold manually for each problem. +So \emph{before} you import the problem set(s), go to the \FM, navigate up one folder, and edit the file \texttt{course.conf}. +Find a blank line anywhere near the bottom and paste the line \begin{center} \verb=$problemDefaults{showMeAnother}=2;= \end{center} or of course use some number other than $2$. +Save, and \emph{then} import your problem sets. +They will all have their SMA threshold set to whatever setting you made. + +\section{Good Ideas to Keep Everything Running Smoothly}\label{goodideas} + +\begin{itemize} + \item Respond as soon as you can to students' requests for assistance. + A fast response rate really improves students' attitudes about using \WW. + Students cite this fast response rate as one of the top two reasons for liking \WW. + (The other is the immediate feedback from \WW\ itself.) + + \item Test the problems that you assign by assigning the homework sets to yourself, and running through all the problems. + Many of the problems are freshly programmed and there are bound to be some mistakes. + Right now the easiest way to handle this is to use the \menu{Email Instructor} button from the offending problem to send yourself a message. + Then forward that email to Alex, Carl, or Chris. + + \item While you do the problems yourself, make note of any special `computer language' that is necessary for completing the set. + For example, that you enter $\pi$ as \texttt{pi}. + Write all this down and include it in the set header. + Mention these items in class too. + + \item Consider giving unlimited attempts to problems. + If the underlying philosophy is that homework is a learning device and not a testing mechanism, then the good that comes from unlimited attempts outweighs the bad. + \begin{itemize} + \item Students are encouraged by the ability to keep trying to solve a problem until they get it right. + + \item There will be some problems where students will swear up and down that they are correct, yet \WW\ marks them incorrect because they `do not know the computer language'. (Sometimes this has merit, but much more often they simply have wrong answers.) They become really upset \emph{if they use up all of their attempts} while completely confident that they are correct. + A negative attitude is more than just a pain for you -- it could reduce the effectiveness of \WW\ as a learning tool. + + \item Suppose that a poorly programmed question escapes your notice during your preview of the assignment. + Suppose that you make the call to alter the problem to fix the issue, as is outlined in a section above. + Suppose that students have \emph{limited} attempts. + By the time you make your changes, several students may have used up all their attempts, and you would need to deal with that. + + \item I find that some proud/too-polite students will not ask for help until they have tried many ($>\!\!10$) attempts. + With limited attempts, these students might just move on after using up their attempts, and never ask for help. + + \end{itemize} + + There will rarely be an opportunity for exhaustive guessing to lead to correct answers. + When a problem does lend itself to exhaustive guessing (e.g. + \ a matching problem), of course that is a good time to limit attempts. + + \item Use the \menu{Statistics} menu to identify which problems are generally causing trouble for your students that you could go over in class. + + \item Use an `attempt threshold' to encourage an email request for help. + For example, you might say ``Email me for help if you are still stuck after five attempts. + '' + + \item Make sure students are aware of the tools they have: + \begin{itemize} + \item The \menu{Email Instructor} button + \item The feedback messages (which students often overlook) + \item Printing hard copies + \item PCC computer access + \item Viewing answers after the answer date + \end{itemize} + The Orientation assignment tries to make them aware of most of these, but redundancy (like mentioning these things every now and then) is helpful. + + \item Give your students a short guide similar to this one, but for students. (I've made one that you are welcome to use or edit.) + + \item If you are using questions that come from a textbook, assign even numbered problems (problems without answers in the back of the book.) Obviously, you don't want a slacker student to just enter the answers from the back. + More importantly, the reasoning behind assigning odd problems is one-upped with \WW. + The purpose of assigning odd problems is so that students can see for themselves when they are incorrect. + \WW\ can do this \emph{without} simultaneously giving away what \emph{is} correct. + + \item If you are using problems that have randomization, encourage students to work together. + They will not be simply able to give each other answers; they will need to communicate process to each other. + This kind of collaborative learning is good for all involved, and the randomization serves as a countermeasure to outright cheating. + +\end{itemize} + +\end{document} + diff --git a/test-cases/test-cases.sh b/test-cases/test-cases.sh index 5ce34467..e89c3b0d 100755 --- a/test-cases/test-cases.sh +++ b/test-cases/test-cases.sh @@ -106,6 +106,10 @@ cd ../tokenChecks/ cd ../cruftdirectory/ [[ $silentMode == 1 ]] && echo "./cruftdirectory/cruft-directory-test-cases.sh" ./cruft-directory-test-cases.sh $silentModeFlag $showCounterFlag $loopminFlag $noisyModeFlag +# STDIN +cd ../STDIN/ +[[ $silentMode == 1 ]] && echo "./STDIN/stdin-test-cases.sh" +./stdin-test-cases.sh $silentModeFlag $showCounterFlag $loopminFlag $noisyModeFlag # named grouping braces cd ../namedGroupingBracesBrackets [[ $silentMode == 1 ]] && echo "./namedGroupingBracesBrackets/named-grouping-test-cases.sh" @@ -141,6 +145,10 @@ cd ../texexchange cd ../horizontalWhiteSpace [[ $silentMode == 1 ]] && echo "./horizontalWhiteSpace/whitespace-test-cases.sh" ./whitespace-test-cases.sh $silentModeFlag $showCounterFlag $loopminFlag $noisyModeFlag +# one sentence per line +cd ../oneSentencePerLine +[[ $silentMode == 1 ]] && echo "./oneSentencePerLine/one-sentence-per-line.sh" +./one-sentence-per-line.sh $silentModeFlag $showCounterFlag $loopminFlag $noisyModeFlag # benchmark mode, if appropriate cd ../benchmarks [[ $benchmarkMode == 1 ]] && ./benchmarks.sh $silentModeFlag $showCounterFlag $loopminFlag $noisyModeFlag diff --git a/test-cases/texexchange/347155-multicol.tex b/test-cases/texexchange/347155-multicol.tex index 8a3ac2a2..0a26868d 100644 --- a/test-cases/texexchange/347155-multicol.tex +++ b/test-cases/texexchange/347155-multicol.tex @@ -2,10 +2,10 @@ \begin{center} \begin{tabular}{|p{2.8cm} |p{2.8cm} |c| c |p{2.8cm} |p{2.8cm} |p{2.8cm}|} \hline - a & b & \multicolumn{2}{c|}{c} & d & e \\ \cline{2-2} \cline{5-2} - & f & \multicolumn{2}{c|}{text of c} & g & \\ + a & b & \multicolumn{2}{c|}{c} & d & e \\ \cline{2-2} \cline{5-2} + & f & \multicolumn{2}{c|}{text of c} & g & \\ \hline - \multicolumn{3}{p(2.8cm}|}{h} & \multicolumn{3}{|c|}{i} \\ + \multicolumn{3}{p(2.8cm}|}{h} & \multicolumn{3}{|c|}{i} \\ \hline \end{tabular} \end{center} diff --git a/test-cases/texexchange/348102-multicol.tex b/test-cases/texexchange/348102-multicol.tex index e8935a04..c62cbccb 100644 --- a/test-cases/texexchange/348102-multicol.tex +++ b/test-cases/texexchange/348102-multicol.tex @@ -5,16 +5,16 @@ \hline \multicolumn{4}{|c|}{\textbf{Search Results}} \\ \hline - 1 & D7 & R & \\ - 2 & D2 & R & \\ - 3 & D3 & NR & \\ - 4 & D5 & R & \\ - 5 & D1 & R & \\ - 6 & D6 & NR & \\ - 7 & D12 & R & \\ - 8 & D15 & NR & \\ - 9 & D21 & NR & \\ - 10 & D9 & R & \\ + 1 & D7 & R & \\ + 2 & D2 & R & \\ + 3 & D3 & NR & \\ + 4 & D5 & R & \\ + 5 & D1 & R & \\ + 6 & D6 & NR & \\ + 7 & D12 & R & \\ + 8 & D15 & NR & \\ + 9 & D21 & NR & \\ + 10 & D9 & R & \\ \hline \multicolumn{3}{|c|}{\textbf{Avg}} & \\ \hline diff --git a/test-cases/texexchange/364871-multicol.tex b/test-cases/texexchange/364871-multicol.tex index 4e47edf1..3e817ef4 100644 --- a/test-cases/texexchange/364871-multicol.tex +++ b/test-cases/texexchange/364871-multicol.tex @@ -3,10 +3,10 @@ \begin{document} \begin{tabular}{|c|c|c|c|c|} \hline - A & 1 & \multicolumn{2}{c|}{2} & \\ \hline - B & \multicolumn{2}{c|}{2} & 1 & \\ + A & 1 & \multicolumn{2}{c|}{2} & \\ \hline + B & \multicolumn{2}{c|}{2} & 1 & \\ \hline - a & b & c & d & e \\ + a & b & c & d & e \\ \hline \end{tabular} @@ -14,8 +14,8 @@ \begin{tabular}{|c|c|c|c|c|} \hline - A & 1 & \multicolumn{2}{c|}{2} & \\ \hline - B & \multicolumn{2}{c|}{2} & 1 & \\ + A & 1 & \multicolumn{2}{c|}{2} & \\ \hline + B & \multicolumn{2}{c|}{2} & 1 & \\ \hline \omit & & & & \end{tabular}