# LaTeX2HTML init file; cf. dot.latex2html-init
#
# If this file needs tweaking depending on LaTeX2HTML
# version, then check the variable $TEX2HTMLVERSION
# and related values set in /usr/bin/latex2html.

# The default setting for HTML_VERSION varies by version:
#
#  +--------------------+----------------------+
#  | LaTeX2HTML version | default HTML_VERSION |
#  +--------------------+----------------------+
#  |     2018.2         |        4.0           |
#  |     2018.3         |        5.0           |
#  |     2021.2         |        5.0           |
#  +--------------------+----------------------+
#
#$HTML_VERSION = "3.2,math";


$LOCAL_ICONS = 1;     # Makes a copy of the icon directory under
                      # the directory containing the final html docs.

$CUSTOM_TITLES = 1;   # Use custom_title_hook to generate filenames

$BODYTEXT = 'BGCOLOR="#FFFFFF",text="#000000",LINK="#0000FF",
             VLINK="#4498F0",ALINK="00FFFF",
             STYLE="width:98.5%; max-width:none; margin:8px;"';
# Note 1: LaTeXHTML version 2021.2 (1-July-2021) writes the following
# into the document .css file:
#
#    BODY { width:95%; max-width:50em; margin:auto; }
#
# The max-width setting limits the text width to 50em. From the
# records in the LaTeX2HTML github repo is looks like this came in
# with the commit
#
#    SHA1 ID 1556639188a2cf9da602e77e499c9852424bd3b5
#    Author: Dan Gildea <dgildea>  2018-06-24 08:11:24
#    Commit message: pdflatex by default, html 5
#
# The 2018.2 release of LaTeX2HTML (16-May-2018) doesn't include this
# so in that release and earlier max-width gets the default value of
# "none". With the values above LaTeX2HTML 2021.2 matches pretty
# closely the output from 2018.2. Adjust as desired.
#
# Note 2: Earlier versions of OOMMF set the background and link colors
# using a "\bodytext" command in oommfhead.tex. I tried appending that
# with the above STYLE attribute, but I wasn't able to the the percent
# sign to pass properly through to the .html output. But it works OK
# here. CAUTION: The \bodytext command overwrites the $BODYTEXT
# setting, so you can't use them in tandem. A related command in the
# html package is \htmlbody, which sets or replaces individual
# attributes, so use that if changes need to be made from the TeX
# source.


### Command Line Argument Defaults #######################################

$TOC_DEPTH = 2;         # Sectioning to this level shown in Table-Of-Contents

$TOC_STARS = 0;         # 0 => Don't include starred sections in TOC.

$MAX_SPLIT_DEPTH = 5;	# Stop making separate files at this depth

$MAX_LINK_DEPTH = 2;    # Stop showing child nodes at this depth   

$TITLE = "OOMMF Documentation";      # The default is "No Title" 

$DESTDIR = '';         # Put the result in this directory 

# When this is set, the generated HTML files will be placed in the 
# current directory. If set to 0 the default behaviour is to create (or reuse)
# another file directory.
$NO_SUBDIR = 0;


# Supply your own string if you don't like the default <Name> <Date>
# $ADDRESS = "<I>$address_data[0] <BR>\n$address_data[1]</I>";
$ADDRESS = "<I>OOMMF Documentation Team<BR><A HREF=\"mailto:michael.donahue\@nist.gov\">michael.donahue\@nist.gov</A><BR>\n$address_data[1]</I>";

$NO_NAVIGATION = 0;	# 1 = do not put a navigation panel at the top of each page

# Put navigation links at the top of each  page.  If  the page  exceeds
# $WORDS_IN_PAGE  number of words then put one at the bottom of the page.
$AUTO_NAVIGATION = 1;

# Put a link to the index page in  the  navigation  panel
$INDEX_IN_NAVIGATION = 1;

# Put a link to the table of contents  in  the  navigation  panel
$CONTENTS_IN_NAVIGATION = 1;

# Put a link to the next logical page  in  the  navigation  panel
$NEXT_PAGE_IN_NAVIGATION = 1;

# Put a link to the previous logical page  in  the  navigation  panel
$PREVIOUS_PAGE_IN_NAVIGATION = 1;

$INFO = 1;              # 0 = do not make a "About this document..." section 

# Reuse images generated during previous runs
$REUSE = 2;

# When this is 1, the section numbers are shown. The section numbers should 
# then match those that would have bee produced by LaTeX.
# The correct section numbers are obtained from the $FILE.aux file generated 
# by LaTeX.
# Hiding the section numbers encourages use of particular sections 
# as standalone documents. In this case the cross reference to a section 
# is shown using the default symbol rather than the section number.
$SHOW_SECTION_NUMBERS = 0;

# If NO_FOOTNODE is true, then footnotes are placed at the bottom of the
# HTML page where they occur, rather than on a separate page.
$NO_FOOTNODE = 1;

### Other global variables ###############################################
#$CHILDLINE = "<BR> <HR>\n";

# Used in conjunction with AUTO_NAVIGATION
$WORDS_IN_PAGE = 300;	

# Affects ONLY the way accents are processed 
$default_language = 'english';	

# The value of this variable determines how many words to use in each 
# title that is added to the navigation panel (see below)
# 
$WORDS_IN_NAVIGATION_PANEL_TITLES = 4;

# This number will determine the size of the equations, special characters,
# and anything which will be converted into an inlined image
# *except* "image generating environments" such as "figure", "table" 
# or "minipage".
# Effective values are those greater than 0.
# Sensible values are between 0.1 - 4.
#$MATH_SCALE_FACTOR = 1.4;
#$DISP_SCALE_FACTOR = 1.2;

# This number will determine the size of 
# image generating environments such as "figure", "table" or "minipage".
# Effective values are those greater than 0.
# Sensible values are between 0.1 - 4.
#$FIGURE_SCALE_FACTOR = 1.6;

# Use scalable font in LaTeX image generation.
$SCALABLE_FONTS = 1;

#  If this is set then intermediate files are left for later inspection.
#  This includes $$_images.tex and $$_images.log created during image
#  conversion.
#  Caution: Intermediate files can be *enormous*.
#$DEBUG = 0;

#  If both of the following two variables are set then the "Up" button
#  of the navigation panel in the first node/page of a converted document
#  will point to $EXTERNAL_UP_LINK. $EXTERNAL_UP_TITLE should be set
#  to some text which describes this external link.
$EXTERNAL_UP_LINK = "";
$EXTERNAL_UP_TITLE = "";

# Valid paper sizes are "letter", "legal", "a4","a3","a2" and "a0"
# Paper sizes has no effect other than in the time it takes to create inlined
# images and in whether large images can be created at all i.e.
#  - larger paper sizes *MAY* help with large image problems 
#  - smaller paper sizes are quicker to handle
$PAPERSIZE = "letter";

# Replace "english" with another language in order to tell LaTeX2HTML that you 
# want some generated section titles (eg "Table of Contents" or "References")
# to appear in a different language. Currently only "english" and "french"
# is supported but it is very easy to add your own. See the example in the
# file "latex2html.config" 
$TITLES_LANGUAGE = "english";

### Navigation Panel ##########################################################
#
# The navigation panel is constructed out of buttons and section titles.
# These can be configured in any combination with arbitrary text and 
# HTML tags interspersed between them. 
# The buttons available are:
# $PREVIOUS - points to the previous section
# $UP  - points up to the "parent" section
# $NEXT - points to the next section
# $NEXT_GROUP - points to the next "group" section
# $PREVIOUS_GROUP - points to the previous "group" section
# $CONTENTS - points to the contents page if there is one
# $INDEX - points to the index page if there is one
#
# If the corresponding section exists the button will contain an
# active link to that section. If the corresponding section does
# not exist the button will be inactive.
#
# Also for each of the $PREVIOUS $UP $NEXT $NEXT_GROUP and $PREVIOUS_GROUP
# buttons there are equivalent $PREVIOUS_TITLE, $UP_TITLE, etc variables
# which contain the titles of their corresponding sections. 
# Each title is empty if there is no corresponding section.
#
# The subroutine below constructs the navigation panels in each page.
# Feel free to mix and match buttons, titles, your own text, your logos,
# and arbitrary HTML (the "." is the Perl concatenation operator).
sub top_navigation_panel {

    # Now add a few buttons with a space between them
    "$NEXT $UP $PREVIOUS $CONTENTS $INDEX $CUSTOM_BUTTONS" .
    
    "<BR>\n" .		# Line break
	
    # If ``next'' section exists, add its title to the navigation panel
    ($NEXT_TITLE ? "<B> Next:</B> $NEXT_TITLE\n" : undef) . 
    
    # Similarly with the ``up'' title ...
    ($UP_TITLE ? "<B>Up:</B> $UP_TITLE\n" : undef) . 
 
    # ... and the ``previous'' title
    ($PREVIOUS_TITLE ? "<B> Previous:</B> $PREVIOUS_TITLE\n" : undef) .
   
    #  Line Break, horizontal rule (3-d dividing line) and new paragraph  
    "<BR> <P>\n"		
}

sub bot_navigation_panel {

    #  Start with a horizontal rule (3-d dividing line)
    "<HR>".			
    
    # Now add a few buttons with a space between them
    "$NEXT $UP $PREVIOUS $CONTENTS $INDEX $CUSTOM_BUTTONS" .
    
    "<BR>\n" .		# Line break
	
    # If ``next'' section exists, add its title to the navigation panel
    ($NEXT_TITLE ? "<B> Next:</B> $NEXT_TITLE\n" : undef) . 
    
    # Similarly with the ``up'' title ...
    ($UP_TITLE ? "<B>Up:</B> $UP_TITLE\n" : undef) . 
 
    # ... and the ``previous'' title
    ($PREVIOUS_TITLE ? "<B> Previous:</B> $PREVIOUS_TITLE\n" : undef) 
   
}

# Disable transparent images, because mmHelp displays these _real_ slow.
# It should be sufficient to set "WHITE_BACKGROUND," and use
# \htmlimage{no_transparent} on larger images, but LaTeX2HTML Version
# 98.2 beta6 (August 14th, 1998) produces gray backgrounds in that situation.
$TRANSPARENT_FIGURES = 0;
$WHITE_BACKGROUND = 1; # Not actually needed if $TRANSPARENT_FIGURES==0,
## but it shouldn't hurt to set this too.

# Image (i.e., equation) background color.  The preceding stanza
# should set the background to white, but for some reason LaTex2HTML
# release 2002-2-1 (1.70) ignores that request unless LATEX_COLOR is
# set in this file...which it then promptly ignores and sets the
# background to white regardless of the setting of LATEX_COLOR.
# Anyway, this seems to work. (mjd, 15-Jan-2003)
#$LATEX_COLOR = "\\pagecolor[gray]{1}";

# LaTeX2HTML 99.2 allows image types selection at
# runtime. Unfortunately, the icon files are defined in the system
# l2hconf.pm file using the value of $IMAGE_TYPE defined there.  So in
# that case the following affects LaTeX generated images, but not the
# icon files.  This discrepancy appears to be fixed in later versions of
# LaTeX2HTML, e.g., 2002-2-1 (1.71).
#
# NB: Leave IMAGE_TYPE unset to allow LaTeX2HTML versions >2018
#  to create equations in svg format (w/ pdflatex processing).
#
#$IMAGE_TYPE = "gif";
#$IMAGE_TYPE = "png";

# On Fedora Core 6 systems (others?), giving dvips the -Ppdf
# option results in bad figure cropping when generating inline
# images.  This hack overrides the settings in prefs.pm.
#$DVIPSOPT = ' -Pcmz -Pamz';

# Set contents of INFO for abbreviated \htmlinfo command
$INFO = "This document was generated using the <A HREF=\"$TEX2HTMLADDRESS\"><STRONG>LaTeX</STRONG>2<tt>HTML</tt></A> translator Version $TEX2HTMLVERSION.";

# Use abbreviated index entries
$SHORT_INDEX = 1;

# LaTeX2HTML 2026-1-1 doesn't recognize \year command.
use Time::Piece;
sub do_cmd_myCurrentYear {
    local($_) = @_;
    return localtime->year . $_;
}

1;	# This must be the last line
