DocBook: implement Mathematical Monthly.

This commit is contained in:
Thibaut Cuvelier 2020-11-27 01:54:00 +01:00
parent 7e5b1d09f3
commit 587f1f5571
5 changed files with 264 additions and 36 deletions

View File

@ -0,0 +1,174 @@
#LyX 2.4 created this file. For more info see https://www.lyx.org/
\lyxformat 599
\begin_document
\begin_header
\save_transient_properties true
\origin unavailable
\textclass maa-monthly
\use_default_options true
\maintain_unincluded_children no
\language english
\language_package default
\inputencoding utf8
\fontencoding auto
\font_roman "default" "default"
\font_sans "default" "default"
\font_typewriter "default" "default"
\font_math "auto" "auto"
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_roman_osf false
\font_sans_osf false
\font_typewriter_osf false
\font_sf_scale 100 100
\font_tt_scale 100 100
\use_microtype false
\use_dash_ligatures false
\graphics default
\default_output_format default
\output_sync 0
\bibtex_command default
\index_command default
\paperfontsize default
\spacing single
\use_hyperref false
\papersize default
\use_geometry true
\use_package amsmath 1
\use_package amssymb 1
\use_package cancel 2
\use_package esint 1
\use_package mathdots 1
\use_package mathtools 0
\use_package mhchem 1
\use_package stackrel 0
\use_package stmaryrd 0
\use_package undertilde 0
\cite_engine basic
\cite_engine_type default
\biblio_style plain
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date false
\justification true
\use_refstyle 1
\use_minted 0
\use_lineno 0
\index Index
\shortcut idx
\color #008000
\end_index
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\paragraph_indentation default
\is_math_indent 0
\math_numbering_side default
\quotes_style english
\dynamic_quotes 0
\papercolumns 1
\papersides 1
\paperpagestyle default
\tablestyle default
\tracking_changes false
\output_changes false
\change_bars false
\postpone_fragile_content false
\html_math_output 0
\html_css_as_file 0
\html_be_strict false
\docbook_table_output 0
\end_header
\begin_body
\begin_layout Title
Sample Article Title
\end_layout
\begin_layout Author
Woodrow Wilson and Herbert Hoover
\end_layout
\begin_layout Abstract
An abstract should not contain concrete mathematics.
\end_layout
\begin_layout Section
First-level section heading.
\end_layout
\begin_layout Standard
Section heading.
\end_layout
\begin_layout Standard
\begin_inset Separator plain
\end_inset
\end_layout
\begin_layout Biographies
\end_layout
\begin_deeper
\begin_layout Author Biography
\begin_inset Argument 1
status open
\begin_layout Plain Layout
Woodrow Wilson
\end_layout
\end_inset
received his Ph.D.
in history and political science from Johns Hopkins University.
He held visiting positions at Cornell and Wesleyan before joining the faculty
at Princeton, where he was eventually appointed president of the university.
Among his proudest accomplishments was the abolition of eating clubs at
Princeton on the grounds that they were elitist.
\end_layout
\begin_layout Affiliation
Office of the President, Princeton University, Princeton NJ 08544
\begin_inset Newline newline
\end_inset
twoodwilson@princeton.edu
\end_layout
\begin_layout Author Biography
\begin_inset Argument 1
status open
\begin_layout Plain Layout
Herbert Hoover
\end_layout
\end_inset
entered Stanford University in 1891, after failing all of the entrance exams
except mathematics.
He received his B.S.
degree in geology in 1895, spent time as a mining engineer, then was appointed
by his co-author to the U.S.
Food Administration and the Supreme Economic Council, where he orchestrated
the greatest famine relief efforts of all time.
\end_layout
\begin_layout Affiliation
Hoover Institution, Stanford University, Stanford CA 94305
\begin_inset Newline newline
\end_inset
herbhoover@stanford.edu
\end_layout
\end_deeper
\end_body
\end_document

View File

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- This DocBook file was created by LyX 2.4.0dev
See http://www.lyx.org/ for more information -->
<article xml:lang="en_US" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:xi="http://www.w3.org/2001/XInclude" version="5.2">
<info>
<title>Sample Article Title</title>
<author>
<personname>Woodrow Wilson and Herbert Hoover</personname>
</author>
<abstract>
<para>An abstract should not contain concrete mathematics.</para>
</abstract>
</info>
<section>
<title>First-level section heading.</title>
<para>Section heading.</para>
</section>
<section>
<title></title>
<para><emphasis role='name'>Woodrow Wilson</emphasis>
received his Ph.D. in history and political science from Johns Hopkins University. He held visiting positions at Cornell and Wesleyan before joining the faculty at Princeton, where he was eventually appointed president of the university. Among his proudest accomplishments was the abolition of eating clubs at Princeton on the grounds that they were elitist.</para>
<para role='affiliation'>Office of the President, Princeton University, Princeton NJ 08544twoodwilson@princeton.edu</para>
<para><emphasis role='name'>Herbert Hoover</emphasis>
entered Stanford University in 1891, after failing all of the entrance exams except mathematics. He received his B.S. degree in geology in 1895, spent time as a mining engineer, then was appointed by his co-author to the U.S. Food Administration and the Supreme Economic Council, where he orchestrated the greatest famine relief efforts of all time.</para>
<para role='affiliation'>Hoover Institution, Stanford University, Stanford CA 94305herbhoover@stanford.edu</para>
</section>
</article>

View File

@ -508,6 +508,8 @@ export/templates/Articles/REVTeX_%28V._4.1%29_docbook5
export/templates/Articles/Kluwer_docbook5
# - Empty bibliography, broken references, empty figures.
export/templates/Articles/Journal_of_the_Acoustical_Society_of_America_%28JASA%29_docbook5
# - Biographies after bibliography: DocBook does not allow content after a bibliography.
export/templates/Articles/Mathematical_Monthly_docbook5
Sublabel: docbook poster
# Posters cannot be properly exported, the LyX documents are too far from

View File

@ -33,16 +33,18 @@ End
Style Abstract
Font
Size Normal
Size Normal
EndFont
LabelType Static
LabelType Static
LabelFont
Size Normal
Series Bold
Size Normal
Series Bold
EndFont
LabelString "Abstract:"
LabelSep " "
Margin Dynamic
LabelString "Abstract:"
LabelSep " "
Margin Dynamic
DocBookTag para
DocBookAbstract true
End
Style Standard
@ -55,6 +57,7 @@ Style Standard
Align Block
AlignPossible Block Center
LabelType No_Label
DocBookTag para
End
Style Author
@ -62,48 +65,60 @@ Style Author
End
Style Abbreviated_Title
CopyStyle Title
LatexType command
LatexName markright
CopyStyle Title
LatexType command
LatexName markright
Font
Size Large
Size Large
EndFont
Align Center
Align Center
DocBookTag titleabbrev
End
Style Biographies
Align Left
Category BackMatter
Category BackMatter
LabelString "Biographies"
LabelType Centered
LabelType Centered
LabelFont
Color Blue
Shape Italic
Color Blue
Shape Italic
Family Roman
EndFont
LatexType Environment
LatexName biog
KeepEmpty 1
# Cannot work properly, as toclevel is set to NOT_IN_TOC.
DocBookSection true
# DocBookSectionTag section
DocBookTag title
DocBookTagType paragraph
DocBookWrapperTag section
End
Style Author_Biography
Align Left
Align Left
Category BackMatter
Argument 1
LabelString "Name"
Mandatory 0
Mandatory 0
DocBookTag emphasis
DocBookAttr role='name'
EndArgument
LabelString "Author Biography"
LabelSep " "
LabelType Static
LabelSep " "
LabelType Static
LabelFont
Color Blue
Shape Italic
Color Blue
Shape Italic
Family Roman
EndFont
LatexType Command
LatexName item
Margin Dynamic
LatexType Command
LatexName item
Margin Dynamic
DocBookTag para
DocBookWrapperTag section
DocBookWrapperMergeWithPrevious true
End
Style Affiliation
@ -120,24 +135,31 @@ Style Affiliation
LatexType Environment
LatexName affil
Margin Dynamic
DocBookTag para
DocBookAttr role='affiliation'
DocBookWrapperTag section
DocBookWrapperMergeWithPrevious true
End
Style Acknowledgments
Category BackMatter
Category BackMatter
Argument 1
LabelString "Title of acknowledgment"
Mandatory 1
LabelString "Title of acknowledgment"
Mandatory 1
EndArgument
LabelString "Acknowledgments"
LabelType Static
LabelSep " "
LabelString "Acknowledgments"
LabelType Static
LabelSep " "
LabelFont
Series Bold
Size Large
Series Bold
Size Large
EndFont
LatexName acknowledgment
LatexType Environment
Margin Dynamic
LatexName acknowledgment
LatexType Environment
Margin Dynamic
DocBookTag para
DocBookWrapperTag acknowledgements
DocBookSection true
End
InsetLayout Flex:URL

View File

@ -1108,6 +1108,9 @@ void docbookParagraphs(Text const &text,
// <h2> after a <h2>, <h3>, <h4>, <h5> or <h6>). More examples:
// - current: h2; back: h1; do not close any <section>
// - current: h1; back: h2; close two <section> (first the <h2>, then the <h1>, so a new <h1> can come)
// Some layouts require that Layout::NOT_IN_TOC sections still cause closing of previous sections. This is
// mostly to ensure that the section is positioned at a DocBook-compatible level (acknowledgements: cannot
// be under a section!).
while (!headerLevels.empty() && level <= headerLevels.top().first) {
// Output the tag only if it corresponds to a legit section.
int stackLevel = headerLevels.top().first;