El soporte para recuadros que existe actualmente en las macros sí admite un color de fondo. También sería relativamente fácil aplicar un color de fondo a cosas como encabezados que no se dividen. Podemos hacer esto porque son un bloque de texto en la página que no necesita ser dividido, así que para poner un color de fondo en la página, literalmente calcula qué tan grande es el bloque de texto, pinta un cuadrado de ese tamaño en la página y coloca el texto encima.
Aunque XeTeX incluye el concepto de color en una fuente, no hay concepto de color de fondo en él, por lo que necesitamos tomar el enfoque anterior. Supongo que sería posible componer un párrafo y luego poner una caja detrás de cada línea individual, pero el problema aquí es que las ascendentes y descendentes probablemente serán pintadas sobre por las líneas posteriores, o la gente se quejará de que las cajas dejan rayas en la página.
Otra opción es escribir fragmentos mágicos de código que hagan algo ingenioso con los puntos de inicio y fin de un párrafo, pero no entiendo lo suficiente el código PDF para saber si siquiera es posible que algo posterior en el archivo pinte debajo de lo que vino antes.
Eso, por supuesto, habla de párrafos, no de palabras. Un método tramposo podría ser dibujar una caja detrás de cada letra, pero esto probablemente tendría algunos efectos secundarios aún más feos que las líneas que mencioné anteriormente.
Para implementar el color de fondo como estás acostumbrado en Word, de modo que pueda aplicarse a todo en una fuente, de manera hermosa y sin trucos feos, probablemente alguien necesitaría modificar XeTeX mismo (y los controladores de dispositivos) para hacer esto. Si ese cambio es un esfuerzo de programación de una semana o de tres meses, no tengo idea.
The sidebar support that exists in the macros at the moment does support a background colour. It would also be relatively easy to apply a background colour to things like headings which don’t split. We can do this because they are a chunk of text on the page that doesn’t need to be split up, so to put a background colour on the page, it literally works out how big the text block is, paints a square that shape on the page and puts the text on top.
While XeTeX includes the concept of colour in the a font, there is no concept of a background colour in it, thus we needed to take the above approach. I guess it would be possible to typeset a paragraph and then put a box behind every single line, but the problem here is that ascenders and descenders will likely get painted over by subsequent lines or people will complain about the boxes leaving stripes on the page.
Another option is to write magic bits of code that do something clever with the start and end points of a paragraph, but I don’t understand PDF-code well enough to know if it is even possible to have something later in the file painting below what’s come earlier.
That is of course talking about paragraphs, not words. A cheating method might be to draw a box behind every letter, but this would probably have some even uglier side-effects than the lines I mentioned earlier
To implement background colour like you are used to in Word, so that it can apply to everything in a font, beautifully without ugly hacks, someone would probably need to modify XeTeX itself (and device drivers) to do this. Whether that change is a week of programming effort or three months, I’ve no idea.
Traducción automática desde English