From 1fc0f43064242f3d2b747e03e6ab4ad069c54276 Mon Sep 17 00:00:00 2001 From: Chris Spiel Date: Wed, 25 Nov 2020 10:11:45 +0100 Subject: [PATCH 1/3] Fix environment name s/FlushLeftRight/FlushRight/. Add some missing end-of-environment macros, which caused warnings. --- ragged2e.hva | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ragged2e.hva b/ragged2e.hva index 32eab931..57a9c160 100644 --- a/ragged2e.hva +++ b/ragged2e.hva @@ -1,10 +1,13 @@ -\let\RaggedRight\raggedright -\let\RaggedLeft\raggedleft \let\Centering\centering +\let\endCentering\relax +\let\RaggedLeft\raggedleft +\let\endRaggedLeft\relax +\let\RaggedRight\raggedright +\let\endRaggedRight\relax \newstyle{.justify}{text-align:justify;margin-left:auto;margin-right:auto;} \newcommand{\justifying}{\@insert{div}{\envclass@attr{justify}}} \newenvironment{Center}{\begin{center}}{\end{center}} \newenvironment{FlushLeft}{\begin{flushleft}}{\end{flushleft}} -\newenvironment{FlushLeftRight}{\begin{flushright}}{\end{flushright}} +\newenvironment{FlushRight}{\begin{flushright}}{\end{flushright}} \setenvclass{justify}{justify} \newenvironment{justify}{\@open{div}{\envclass@attr{justify}}}{\@close{div}} From 2255a4e36dfb3e74d486aab05775192b969a18b6 Mon Sep 17 00:00:00 2001 From: Chris Spiel Date: Thu, 26 Nov 2020 15:19:39 +0100 Subject: [PATCH 2/3] Remove conditional in Html.insert_block to get correct translation of e.g. `\raggedleft', `\raggedright', and `\centering'. --- html.ml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/html.ml b/html.ml index bad3a44e..f4c67edc 100644 --- a/html.ml +++ b/html.ml @@ -484,11 +484,7 @@ and flush_out = flush_out and close_group = close_group and open_aftergroup = open_aftergroup and open_group = open_group -and insert_block s attr = - if find_prev_par () then - warning "Ignoring \\centering or \\ragged..." - else - insert_block (find_block s) attr +and insert_block s attr = insert_block (find_block s) attr and insert_attr s = insert_attr (find_block s) and erase_mods = erase_mods and open_mod = open_mod From c99dae56046cdefc12147135d6da30773f1bf96f Mon Sep 17 00:00:00 2001 From: Chris Spiel Date: Thu, 26 Nov 2020 15:22:24 +0100 Subject: [PATCH 3/3] Add missing macro `\justifying' (from ragged2e) in text mode. Force text alignment inside of (HTML) `\parbox' to follow LaTeX's default layout (ragged2e modifications to `\parbox' are ignored). --- html/hevea.hva | 1 + text/hevea.hva | 1 + 2 files changed, 2 insertions(+) diff --git a/html/hevea.hva b/html/hevea.hva index f78dc3f3..8c89848b 100644 --- a/html/hevea.hva +++ b/html/hevea.hva @@ -387,6 +387,7 @@ \newstyle{.parbox}{ box-sizing: border-box; display: inline-block; + text-align: justify; text-indent: 0; } \def\@parbox@alignment@spec@bottom{b} diff --git a/text/hevea.hva b/text/hevea.hva index d1ab77b5..00294c55 100644 --- a/text/hevea.hva +++ b/text/hevea.hva @@ -123,6 +123,7 @@ \newcommand{\centering}{\@insert{align}{center}} \newcommand{\raggedleft}{\@insert{align}{right}} \newcommand{\raggedright}{\@insert{align}{left}} +\let\justifying\raggedright %%%%%%%%%%% Figures %For figure & tables \newcommand{\@open@quote}[1]{\@open{quote}{}}