[tex4ht] How to add custom Css code into the configuration file? @media

Nasser M. Abbasi nma at 12000.org
Wed Aug 30 06:46:49 CEST 2023


Opps, I copied the code with a missing ending extra } at the end.

Here is the correct code in cfg. It still gives same syntax error

------------------------------------------------------
\Css{@media only screen and (min-width: 100px) and (max-width: 960px) {
body{margin-top: 1em; margin-bottom: 1em; width: auto; max-width: 90%;
margin-left: auto; margin-right: auto; padding: 0em; color: #444;
font-family: arial, sans-serif; line-height: 1.5;
font-style: normal; font-size: 1.0em; text-align:justify; background: #FFFFFF;}
}}
---------------------

Runaway argument?
{@media only screen and (min-width: 100px) and (max-width: 960px) { b\ETC.
! Paragraph ended before \Css was complete.
<to be read again>
\par

I tried escaping it using  \@media but that did not work.

Thanks
--Nasser

On 8/29/2023 11:29 PM, Nasser M. Abbasi wrote:
> 
> I am trying to add this custom code into my .cfg file, using \Css{...}
> that I always used, but it gives syntax error.
> 
> 
> The code works fine if I add it manually to the index.css file
> after compiling. But I need to put it to my .cfg file so it automatically
> go inot each generated .css
> 
> The code is below. I got it from this web site
> 
> https://www.thatcompany.com/making-fixed-width-website-mobile-friendly
> 
> -------------------
> 
> @media only screen and (min-width: 100px) and (max-width: 960px) {
> body{margin-top: 1em; margin-bottom: 1em;
>        width: auto; max-width: 90%; margin-left: auto;
>        margin-right: auto; padding: 0em; color: #444;
>        font-family: arial, sans-serif; line-height: 1.5;
>        font-style: normal; font-size: 1.0em;
>        text-align:justify; background: #FFFFFF;}
> ------------------------
> 
> in the .cfg file for tex4ht, I just added \Css{..} to the above giving
> 
> -------------------
> \Css{@media only screen and (min-width: 100px) and (max-width: 960px) {
> body{margin-top: 1em; margin-bottom: 1em;
>        width: auto; max-width: 90%; margin-left: auto;
>        margin-right: auto; padding: 0em; color: #444;
>        font-family: arial, sans-serif; line-height: 1.5;
>        font-style: normal; font-size: 1.0em;
>        text-align:justify; background: #FFFFFF;}
> }
> -----------------
> 
> But when I compile with make4ht, the error is
> 
> Runaway argument?
> {@media only screen and (min-width: 100px) and (max-width: 960px) { b\ETC.
> ! Paragraph ended before \Css was complete.
> <to be read again>
> \par
> 
> 
> Is the problem the use of @ in media?
> 
> Thank you,
> --Nasser
> 
> 
> 
> 



More information about the tex4ht mailing list.