Re: [sphinx-users] Vertical space after latex command

2020-11-25 Thread Daniel Scott
On Mon, Aug 3, 2020, 4:41 PM bradley...@gmail.com 
wrote:

>
> I like to put macro definitions at the top of my latex files. It seems
> that sphinx generates empty vertical space when I do this in rst files.
> Attached is a conf.py and index.rst file that demonstrates this problem:
>
> Is there some place I can put a set of latex macro definitions and not
> have this problem ?
>
> --
> You received this message because you are subscribed to the Google Groups
> "sphinx-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sphinx-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sphinx-users/5e3ae8c2-d593-4afc-b628-1bf1ff2bdb76n%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sphinx-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sphinx-users/CAELGjd_QnZ9gubhow0UOrxGkPsvTfcC4SW9yPwCF%2Bx-zUz%3DXaw%40mail.gmail.com.


Re: [sphinx-users] Vertical space after latex command

2020-08-13 Thread Matthias Geier
On Wed, Aug 12, 2020 at 1:34 PM bradley...@gmail.com wrote:
>
> Thanks for the suggestion. I used the instructions on
> https://blog.readthedocs.com/custom-css-and-js-in-sphinx/
> to add a style sheet and it worked.

I'm glad it worked for you!

> To be specific, I added the file _static/css/custom.css with the following 
> text:
>
> /* preamble used to add hidden class */
>
> .hidden {
> display: None;
> }
>
> I changed my latex macro to
>
> .. rst-class:: hidden
>
> :math:`\newcommand{\B}[1]{ {\bf #1} }`

Please note that the indentation after the "rst-class" directive is
not necessary (I'm not sure whether it's harmful).

The "rst-class" directive simply applies a CSS class to the following
element, it doesn't create its own element.

cheers,
Matthias

> I added the following at the end of my conf.py
>
> # -- These folders are copied to the documentation's HTML output 
> 
> html_static_path = [ '_static' ]
>
> # -- These paths are either relative to html_static_path 
> 
> # or fully qualified paths (eg. https://...)
> html_css_files = [
> 'css/custom.css',
> ]
>
>
>
> On Tuesday, August 11, 2020 at 3:54:34 AM UTC-7 matthia...@gmail.com wrote:
>>
>> On Tue, Aug 4, 2020 at 1:41 AM bradley...@gmail.com wrote:
>> >
>> > I like to put macro definitions at the top of my latex files. It seems 
>> > that sphinx generates empty vertical space when I do this in rst files. 
>> > Attached is a conf.py and index.rst file that demonstrates this problem:
>> >
>> > Is there some place I can put a set of latex macro definitions and not 
>> > have this problem ?
>>
>> It's a bit of a hack, but you can try something like this:
>>
>> 
>>
>> .. raw:: html
>>
>> 
>>
>> :math:`\newcommand{\B}[1]{{\bf #1}}`
>>
>> .. raw:: html
>>
>> 
>>
>> 
>>
>> Alternatively, you can do it with a CSS class, which makes the .rst
>> file a bit simpler:
>>
>> 
>> .. rst-class:: hidden
>>
>> :math:`\newcommand{\B}[1]{{\bf #1}}`
>> 
>>
>> ... but you need to defined some custom CSS:
>>
>> 
>> .hidden {
>> display: none;
>> }
>> 
>>
>> cheers,
>> Matthias
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sphinx-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sphinx-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sphinx-users/4664d0c2-14c8-4430-87a7-626d9336304an%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sphinx-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sphinx-users/CAFesC-fRcMvbFHzh4G92DyNmc_MCV7iiV6Xeigt6EsB_g55W%2BA%40mail.gmail.com.


Re: [sphinx-users] Vertical space after latex command

2020-08-12 Thread bradley...@gmail.com
Thanks for the suggestion. I used the instructions on 
https://blog.readthedocs.com/custom-css-and-js-in-sphinx/
to add a style sheet and it worked.

To be specific, I added the file _static/css/custom.css with the following 
text:

/* preamble used to add hidden class */

.hidden {
display: None;
}

I changed my latex macro to

.. rst-class:: hidden

:math:`\newcommand{\B}[1]{ {\bf #1} }`


I added the following at the end of my conf.py
 
# -- These folders are copied to the documentation's HTML output 

html_static_path = [ '_static' ]

# -- These paths are either relative to html_static_path 

# or fully qualified paths (eg. https://...)
html_css_files = [
'css/custom.css',
]


 
On Tuesday, August 11, 2020 at 3:54:34 AM UTC-7 matthia...@gmail.com wrote:

> On Tue, Aug 4, 2020 at 1:41 AM bradley...@gmail.com wrote:
> >
> > I like to put macro definitions at the top of my latex files. It seems 
> that sphinx generates empty vertical space when I do this in rst files. 
> Attached is a conf.py and index.rst file that demonstrates this problem:
> >
> > Is there some place I can put a set of latex macro definitions and not 
> have this problem ?
>
> It's a bit of a hack, but you can try something like this:
>
> 
>
> .. raw:: html
>
> 
>
> :math:`\newcommand{\B}[1]{{\bf #1}}`
>
> .. raw:: html
>
> 
>
> 
>
> Alternatively, you can do it with a CSS class, which makes the .rst
> file a bit simpler:
>
> 
> .. rst-class:: hidden
>
> :math:`\newcommand{\B}[1]{{\bf #1}}`
> 
>
> ... but you need to defined some custom CSS:
>
> 
> .hidden {
> display: none;
> }
> 
>
> cheers,
> Matthias
>

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sphinx-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sphinx-users/4664d0c2-14c8-4430-87a7-626d9336304an%40googlegroups.com.


Re: [sphinx-users] Vertical space after latex command

2020-08-11 Thread Matthias Geier
On Tue, Aug 4, 2020 at 1:41 AM bradley...@gmail.com wrote:
>
> I like to put macro definitions at the top of my latex files. It seems that 
> sphinx generates empty vertical space when I do this in rst files. Attached 
> is a conf.py and index.rst file that demonstrates this problem:
>
> Is there some place I can put a set of latex macro definitions and not have 
> this problem ?

It's a bit of a hack, but you can try something like this:



.. raw:: html



:math:`\newcommand{\B}[1]{{\bf #1}}`

.. raw:: html





Alternatively, you can do it with a CSS class, which makes the .rst
file a bit simpler:


.. rst-class:: hidden

:math:`\newcommand{\B}[1]{{\bf #1}}`


... but you need to defined some custom CSS:


.hidden {
display: none;
}


cheers,
Matthias

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sphinx-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sphinx-users/CAFesC-frAcGSYZ6-MEwzAVNbuMJa5BspnNk5ev%3DpE05QuM%2BfYQ%40mail.gmail.com.


[sphinx-users] Vertical space after latex command

2020-08-03 Thread bradley...@gmail.com

I like to put macro definitions at the top of my latex files. It seems that 
sphinx generates empty vertical space when I do this in rst files. Attached 
is a conf.py and index.rst file that demonstrates this problem:

Is there some place I can put a set of latex macro definitions and not have 
this problem ?

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sphinx-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sphinx-users/5e3ae8c2-d593-4afc-b628-1bf1ff2bdb76n%40googlegroups.com.
# For conf.py documentation see
# http://www.sphinx-doc.org/en/master/config
#
project   = 'latex_space'
extensions = [
'sphinx.ext.mathjax',
]
exclude_patterns = [
'_build', 'Thumbs.db', '.DS_Store',
]
:math:`\newcommand{\B}[1]{{\bf #1}}`

Vertical Space After Latex Command
==
I often put macros definitions at the top of my latex files; e.g,
I have put the following definition at the top of this rst file:

| \:math\: \`\\newcommand{\\B}[1]{{\\bf #1}}\`

This latex command has no output, but it causes more white space to be placed
before the title in the html version of this file (as generated by sphinx).
If you delete the first line of this file (which containts the latex command)
the title in the html version will move up.