From: <Ste...@te...> - 2016-04-05 11:45:08
|
Hi all, Is there a markup in reStructuredText, that forces a line break only, and is not interpreted as a block quote with indentation like line block? I would like to force line breaks in a numerated list. #. | First line | Second line | Third line #. Item with only one line #. Another item Looking at restructuredText examples and the rtd theme, the line block markup seems to be expected to be rendered with a left margin in html, while it does not produce a margin with latex. As a consequence, the first item will be indented by 24px and the one line Items are not indented. Is there an alternative markup, or do I have to customise the css? BR, Stefan |
From: Matěj C. <mc...@ce...> - 2016-04-05 13:01:29
|
On 2016-04-05, 11:24 GMT, <Ste...@te...> wrote: > I would like to force line breaks in a numerated list. > > #. | First line > | Second line > | Third line > #. Item with only one line > #. Another item I am afraid you hold the phone wrong ;). Really, what you want here is embedded list inside of the first item. Matěj -- https://matej.ceplovi.cz/blog/, Jabber: mc...@ce... GPG Finger: 89EF 4BC6 288A BF43 1BAB 25C3 E09F EF25 D964 84AC ..every Man has a Property in his own Person. This no Body has any Right to but himself. The Labour of his Body, and the Work of his Hands, we may say, are properly his. .... The great and chief end therefore, of Mens uniting into Commonwealths, and putting themselves under Government, is the Preservation of their Property. -- John Locke, "A Treatise Concerning Civil Government" |
From: Guenter M. <mi...@us...> - 2016-04-05 15:37:50
|
On 2016-04-05, <Ste...@te...> wrote: > [-- Type: text/plain, Encoding: quoted-printable --] > Hi all, > Is there a markup in reStructuredText, that forces a line break only, > and is not interpreted as a block quote with indentation like line block? > I would like to force line breaks in a numerated list. > #. | First line > | Second line > | Third line > #. Item with only one line > #. Another item > Looking at restructuredText examples and the rtd theme, the line block > markup seems to be expected to be rendered with a left margin in html, > while it does not produce a margin with latex. > As a consequence, the first item will be indented by 24px and the one line > Items are not indented. In my setup, the line-block in a list is not indented further but aligns with the following item. Did you try your markup? Do you already use a custom CSS? > Is there an alternative markup, or do I have to customise the css? There is nothing like :: #. First line <br> Second line <br> Third line <br> #. Item with only one line You can, however write paragraphs, say: #. First line Second line Third line #. Item with only one line With the html5 writer (in the development version of Docutils) you can remove spacing between the paragraphs and list items whith the class value "compact" for the list: .. class:: compact #. First line Second line Third line #. Item with only one line The following works in most browsers but does not validate (<style> is only allowed in the document head):: .. raw:: html <style type="text/css"><!-- li div.line-block { margin-left: 0px; color: red; /* for testing */ } --></style> hope this helps, Günter |
From: Bram G. <br...@br...> - 2016-04-05 16:28:09
|
The pseudoxml writer shows that the intention of your RST code is correctly parsed: > <enumerated_list enumtype="arabic" prefix="" suffix="."> > <list_item> > <line_block> > <line> > First line > <line> > Second line > <line> > Third line > <list_item> > <paragraph> > Item with only one line > <list_item> > <paragraph> > Another item This is what the RST "really means". How it gets turned into HTML/LaTeX is subjective; you can use many stylesheets or even HTML trees for HTML, and many document types for LaTeX. You might need to configure/tweak either writer for your purposes. Cheers, Bram On Tue, 5 Apr 2016, at 04:35 PM, Guenter Milde wrote: > On 2016-04-05, <Ste...@te...> wrote: > > > [-- Type: text/plain, Encoding: quoted-printable --] > > > Hi all, > > > Is there a markup in reStructuredText, that forces a line break only, > > and is not interpreted as a block quote with indentation like line block? > > > I would like to force line breaks in a numerated list. > > > #. | First line > > | Second line > > | Third line > > #. Item with only one line > > #. Another item > > > Looking at restructuredText examples and the rtd theme, the line block > > markup seems to be expected to be rendered with a left margin in html, > > while it does not produce a margin with latex. > > As a consequence, the first item will be indented by 24px and the one line > > Items are not indented. > > In my setup, the line-block in a list is not indented further but aligns > with the following item. Did you try your markup? Do you already use a > custom CSS? > > > > Is there an alternative markup, or do I have to customise the css? > > There is nothing like :: > > #. First line <br> > Second line <br> > Third line <br> > #. Item with only one line > > > You can, however write paragraphs, say: > > #. First line > > Second line > > Third line > > #. Item with only one line > > > With the html5 writer (in the development version of Docutils) you can > remove spacing between the paragraphs and list items whith the class > value > "compact" for the list: > > .. class:: compact > > #. First line > > Second line > > Third line > > #. Item with only one line > > > The following works in most browsers but does not validate (<style> is > only > allowed in the document head):: > > .. raw:: html > > <style type="text/css"><!-- > li div.line-block { > margin-left: 0px; > color: red; /* for testing */ > } > --></style> > > > hope this helps, > > Günter > > > ------------------------------------------------------------------------------ > _______________________________________________ > Docutils-users mailing list > Doc...@li... > https://lists.sourceforge.net/lists/listinfo/docutils-users > > Please use "Reply All" to reply to the list. |