{"id":682,"date":"2013-07-31T09:12:03","date_gmt":"2013-07-31T09:12:03","guid":{"rendered":"http:\/\/www.cvr.cc\/?p=682"},"modified":"2013-07-31T09:12:03","modified_gmt":"2013-07-31T09:12:03","slug":"tex4ht-and-multicolumn-layout","status":"publish","type":"post","link":"https:\/\/cvr.cc\/?p=682","title":{"rendered":"TeX4ht and Multicolumn Layout"},"content":{"rendered":"<p><a href=\"http:\/\/www.12000.org\/\">Nasser M. Abbassi<\/a> had filed a feature request at <a href=\"http:\/\/puszcza.gnu.org.ua\/bugs\/?188\">T<span style=\"position: relative; top: 0.5ex; margin-left: -0.1667em; margin-right: -0.125em; text-transform: uppercase;\">e<\/span>X4ht<\/a> project for multicolumn support in T<span style=\"position: relative; top: 0.5ex; margin-left: -0.1667em; margin-right: -0.125em; text-transform: uppercase;\">e<\/span>X4ht which is lacking at the moment. <a href=\"http:\/\/www.w3.org\/TR\/css3-multicol\/\">This link<\/a> provides the latest specifications of <a href=\"http:\/\/www.w3.org\">W3C<\/a> relating to multicolumn layout in HTML which some of the mainstream browsers support in varying degrees. Our initial efforts are pointed towards <code>multicol<\/code> package so that T<span style=\"position: relative; top: 0.5ex; margin-left: -0.1667em; margin-right: -0.125em; text-transform: uppercase;\">e<\/span>X4ht provides enough hooks to generate output with multicolumn layout as envisaged in <span class=\"LATEX\">L<span class=\"A\">A<\/span><span class=\"TEX\">T<span class=\"E\">E<\/span>X<\/span><\/span> by <code>multicol<\/code> package. Support for <code>\\twocolumn<\/code> still remains to be done, though.<\/p>\n<p><!--more--><\/p>\n<h4 style=\"color: #27d;\">Approach to the Problem<\/h4>\n<p><a id=\"x1-3000doc\" name=\"x1-3000doc\"><\/a><\/p>\n<p>W3C provides different kinds of CSS properties to bring about multicolumn layout in HTML. These are briefly listed below:<\/p>\n<ol>\n<li><code>column-count<\/code>: number of columns<\/li>\n<li><code>column-width<\/code>: width of the columns<\/li>\n<li><code>column-gap<\/code>: gap between columns<\/li>\n<li><code>column-rule-color<\/code>: color of separator rule<\/li>\n<li><code>column-rule-width<\/code>: width of separator rule<\/li>\n<li><code>column-rule-style<\/code>: style of separator rule<\/li>\n<li><code>column-span<\/code>: should the entry span all columns<\/li>\n<li><code>column-fill<\/code>: should the multicolumn layout be balanced or ragged<\/li>\n<li><code>column-break<\/code>: directive for breaks in print media<\/li>\n<\/ol>\n<p>We have more or less equivalent commands in <code>multicol<\/code> package and are listed below:<\/p>\n<ol>\n<li><code>\\columnbreak<\/code>: forced break in a column<\/li>\n<li><code>\\columnsep<\/code>: gap between columns<\/li>\n<li><code>\\columnseprule<\/code>: rule width<\/li>\n<li><code>\\columnseprulecolor<\/code>: rule color<\/li>\n<li><code>\\flushcolumns<\/code>: balanced columns<\/li>\n<li><code>\\raggedcolumns<\/code>: unbalanced columns<\/li>\n<li><code>\\begin{multicols}{&lt;num&gt;}<\/code>: beginning of multicolumn enviromnemt<\/li>\n<li><code>\\end{multicols}<\/code>: end of multicolumn environment<\/li>\n<li><code>\\multicoltolerance<\/code>: no effect on HTML output<\/li>\n<\/ol>\n<p>Some of the CSS properties do not have equivalent commands in <code>multicol<\/code> package. For instance, <code>column-width<\/code> can be specified in CSS as either <code>auto<\/code> or as a legal dimension, but in <code>multicol<\/code>, it is always automatically computed. Hence, we can safely ignore such properties. Conversely, certain <code>multicol<\/code> commands like <code>\\multicoltolerance<\/code> has no effect in HTML, so we can ignore such commands in the source documents.<\/p>\n<p>We have written the <code>multicol.4ht<\/code> to redefine the related <code>multicol<\/code> commands to generate the equivalent CSS properties for HTML output so that multicolumn layout is visually similar to PDF output.<\/p>\n<h4 style=\"color: #27d;\">Usage<\/h4>\n<p><a id=\"x1-4000doc\" name=\"x1-4000doc\"><\/a><\/p>\n<p>The multicolumn layout can be tailored using <code>\\Configure<\/code> command on various items as given below:<\/p>\n<pre style=\"overflow: auto; padding: 1em; margin-left: 0em; font-family: monospace; color: olive; border: solid 1px; border-color: #ddd; border-radius: 4px ; -moz-border-radius: 4px 4px 4px 4px; -webkit-border-radius: 4px 4px 4px 4px; background-color: #f5f5f5; font-size: 1em;\">\n\\Configure{columngap}{\\thecolumnsep}\n<\/pre>\n<p><code><\/p>\n<p><\/code><\/p>\n<p><code>\\columngap<\/code> will default to the dimension provided by <code>multicol<\/code>&rsquo;s <code>\\columnsep<\/code> command. However, if you want to override, you can make use of the above command. The legal values admissible are any valid <code>\\dimen<\/code> or simply <code>\\normal<\/code> which is considered to be 1em.<\/p>\n<pre style=\"overflow: auto; padding: 1em; margin-left: 0em; font-family: monospace; color: olive; border: solid 1px; border-color: #ddd; border-radius: 4px ; -moz-border-radius: 4px 4px 4px 4px; -webkit-border-radius: 4px 4px 4px 4px; background-color: #f5f5f5; font-size: 1em;\">\n\\Configure{columnrulewidth}{\\thecolumnseprule}\n<\/pre>\n<p><code><\/p>\n<p><\/code><\/p>\n<p><code>\\columnrulewidth<\/code> defaults to <span class=\"LATEX\">L<span class=\"A\">A<\/span><span class=\"TEX\">T<span class=\"E\">E<\/span>X<\/span><\/span> dimension provided by <code>\\columnseprule<\/code> which can be overridden by the above command. The legal values are <code>thin | medium | thick<\/code> or any valid dimension.<\/p>\n<pre style=\"overflow: auto; padding: 1em; margin-left: 0em; font-family: monospace; color: olive; border: solid 1px; border-color: #ddd; border-radius: 4px ; -moz-border-radius: 4px 4px 4px 4px; -webkit-border-radius: 4px 4px 4px 4px; background-color: #f5f5f5; font-size: 1em;\">\n\\Configure{columnrulecolor}{#555;}\n<\/pre>\n<p>You can specify any valid color for <code>\\columnrulecolor<\/code>. Default is provided above.<\/p>\n<pre style=\"overflow: auto; padding: 1em; margin-left: 0em; font-family: monospace; color: olive; border: solid 1px; border-color: #ddd; border-radius: 4px ; -moz-border-radius: 4px 4px 4px 4px; -webkit-border-radius: 4px 4px 4px 4px; background-color: #f5f5f5; font-size: 1em;\">\n\\Configure{columnrulestyle}{outset}\n<\/pre>\n<p><code><\/p>\n<p><\/code><\/p>\n<p><code>\\columnrulestyle<\/code> has no equivalent in <code>multicol<\/code>. Specify rule style with the above hook. Legal values are provided below: <code>none<\/code>, <code>hidden<\/code>, <code>dotted<\/code>, <code>dashed<\/code>, <code>solid<\/code>, <code>double<\/code>, <code>groove<\/code>, <code>ridge<\/code>, <code>inset<\/code>, <code>outset<\/code>,<\/p>\n<pre style=\"overflow: auto; padding: 1em; margin-left: 0em; font-family: monospace; color: olive; border: solid 1px; border-color: #ddd; border-radius: 4px ; -moz-border-radius: 4px 4px 4px 4px; -webkit-border-radius: 4px 4px 4px 4px; background-color: #f5f5f5; font-size: 1em;\">\n\\Configure{columnspan}{none}\n<\/pre>\n<p><code><\/p>\n<p><\/code><\/p>\n<p><code>\\columnspan<\/code> has no equivalent command in <code>multicol<\/code>. This is to provide CSS directive of any column spanning all the columns, the default value being <code>none<\/code>. Alternate value is <code>all<\/code>.<\/p>\n<pre style=\"overflow: auto; padding: 1em; margin-left: 0em; font-family: monospace; color: olive; border: solid 1px; border-color: #ddd; border-radius: 4px ; -moz-border-radius: 4px 4px 4px 4px; -webkit-border-radius: 4px 4px 4px 4px; background-color: #f5f5f5; font-size: 1em;\">\n\\Configure{columnfill}{balance}\n<\/pre>\n<p><code><\/p>\n<p><\/code><\/p>\n<p><code>\\columnfill<\/code> does the job what <code>\\raggedcolumns<\/code> and <code>\\flushcolumns<\/code> do in <code>multicol<\/code>. <code>balance<\/code>, meaning, balanced columns is the default value, the other being <code>auto<\/code>.<\/p>\n<pre style=\"overflow: auto; padding: 1em; margin-left: 0em; font-family: monospace; color: olive; border: solid 1px; border-color: #ddd; border-radius: 4px ; -moz-border-radius: 4px 4px 4px 4px; -webkit-border-radius: 4px 4px 4px 4px; background-color: #f5f5f5; font-size: 1em;\">\n\\Configure{multicols}{columns}\n<\/pre>\n<p>This command provides the name of class attribute of the multicolumn chunk of text. You can assign any string of your choice, the default is <code>columns<\/code>.<\/p>\n<h4 style=\"color: #27d;\">Example<\/h4>\n<p><a id=\"x1-5000doc\" name=\"x1-5000doc\"><\/a>Here is an example of a working document that can be used to test these newly introduced features.<\/p>\n<pre style=\"overflow: auto; padding: 1em; margin-left: 0em; font-family: monospace; color: olive; border: solid 1px; border-color: #ddd; border-radius: 4px ; -moz-border-radius: 4px 4px 4px 4px; -webkit-border-radius: 4px 4px 4px 4px; background-color: #f5f5f5; font-size: 1em;\">\n\\documentclass[a4paper]{article}\n\\usepackage{xspace}\n\\usepackage{lipsum}\n\\usepackage[margin=1cm,ignoreall]{geometry}\n\\usepackage{multicol}\n\\columnseprule=.1pt\n\\columnsep=1em\n\n\\begin{document}\n\n\\parindent=0pt\n% For webkit browsers Chrome, for example,\n% kindly remove comment marks from two lines below:\n%\n% \\Configure{columnrulecolor}{#000;}\n% \\Configure{columnrulewidth}{1px}\n\n\\title{Support for Multicolumn Layout in TeX4ht}\n\\author{TeX4ht Project Team}\n\\maketitle\n\n\\lipsum[1]\n\\begin{multicols}{2}[section{Testing the Section Heading}]\n\\lipsum[2-8]\n\\end{multicols}\n\\lipsum[1]\n\\begin{multicols}{3}[section{Three Column Layout}]\n\\lipsum[2-8]\n\\end{multicols}\n\\lipsum[1]\n\\begin{multicols}{4}[section{Four Column Layout}]\n\\lipsum[2-8]\n\\end{multicols}\n\\lipsum[1]\n\\ifx\\HCode\\undefined\\raggedright\\fi\n\\begin{multicols}{11}[section{More Than Ten Columns limit of\n    multicol package}]\n\\lipsum[2-8]\n\\end{multicols}\n\n\\end{document}\n<\/pre>\n<p>The HTML output can be viewed <a href=\" http:\/\/download.river-valley.com\/cvr\/tex4ht\/multicols\/mcoltest.html\">here<\/a>.<\/p>\n<p>A tarball of all required <code>*.4ht<\/code> files, source, auxiliary and output files can be downloaded from <a href=\" http:\/\/download.river-valley.com\/cvr\/tex4ht\/multicols\/multicols.tar.gz\">here<\/a>.<\/p>\n<h4 style=\"color: #27d;\">W3C References<\/h4>\n<p><a id=\"x1-6000doc\" name=\"x1-6000doc\"><\/a><\/p>\n<p>More detailed information is available at <a href=\"http:\/\/www.w3.org\/TR\/css3-multicol\/#property-index\">Property Index<\/a> page provided at Word Wide Web Consortium web site. (Generated by Org mode 8.0.6 in Emacs 24.3.1.)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Nasser M. Abbassi had filed a feature request at TeX4ht project for multicolumn support in TeX4ht which is lacking at the moment. This link provides the latest specifications of W3C relating to multicolumn layout in HTML which some of the mainstream browsers support in varying degrees. Our initial efforts are pointed towards multicol package so [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28,15,16],"tags":[],"class_list":["post-682","post","type-post","status-publish","format-standard","hentry","category-multicolumn","category-tex","category-tex4ht"],"_links":{"self":[{"href":"https:\/\/cvr.cc\/index.php?rest_route=\/wp\/v2\/posts\/682","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cvr.cc\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cvr.cc\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cvr.cc\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cvr.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=682"}],"version-history":[{"count":0,"href":"https:\/\/cvr.cc\/index.php?rest_route=\/wp\/v2\/posts\/682\/revisions"}],"wp:attachment":[{"href":"https:\/\/cvr.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=682"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cvr.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=682"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cvr.cc\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=682"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}