LyXLyx spacing & wrapping

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
samirazs
Posts: 3
Joined: Thu Jan 17, 2013 10:45 am

Lyx spacing & wrapping

Post by samirazs »

Hi,

I am using Lyx standard thesis template (LyX20\Resources\templates\thesis), but am having trouble with the layout. I have not changed much in the template's default settings. If you would please look at the attachement, you'll see that the first trouble is the wrapping with urls... they are not working properly. (breakurl is already there)
The second trouble is the spacing between words, which is too much in some examples.

Can you please help me?

Cheers,
Samira
Attachments
Bibtex spacing and wrapping
Bibtex spacing and wrapping
lyx forum.PNG (26.72 KiB) Viewed 4919 times
Last edited by samirazs on Thu Jan 17, 2013 11:52 am, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Lyx spacing & wrapping

Post by Stefan Kottwitz »

Hi Samira,

welcome to the board!

The problem here is the line breaking, LyX and LaTeX don't break the URLs at arbitrary places but for example at dashes, for readability of complex URLs. The consequence is that the justification is hardly possible which results in bad spacing.

You could extend the line breaking. For example, like I wrote in: Re: Failure to word-wrap inside enumerate environment, you could add this in your document preamble to allow line breaks for all lower case letters too:

Code: Select all

\expandafter\def\expandafter\UrlBreaks\expandafter{\UrlBreaks\do\a%
\do\b\do\c\do\d\do\e\do\f\do\g\do\h\do\i\do\j\do\k\do\l\do\m\do\n%
\do\o\do\p\do\q\do\r\do\s\do\t\do\u\do\v\do\w\do\x\do\y\do\z\do\&}
You can see the structure and may easily extend or reduce it.

Stefan
LaTeX.org admin
samirazs
Posts: 3
Joined: Thu Jan 17, 2013 10:45 am

Re: Lyx spacing & wrapping

Post by samirazs »

Hi Stefan,

Thankyou very much for your fast reply! I am so sorry to ask, but is this how it should be added? Because the spaces and wrapping are still there.
Attachments
Adding expandafter
Adding expandafter
lyx forum 2.PNG (52.53 KiB) Viewed 4912 times
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Re: Lyx spacing & wrapping

Post by Stefan Kottwitz »

The place is correct. To investigate the reason in your specific case, why it doesn't work, you could post your LyX document as attachment to a post here in the forum. To protect your content, and to make help possible, post a copy of the document which is reduced as much as possible (without non-relevant text, packages etc.). Also your bibliography entries (.bib file) would be needed.

Once we can test and verify the problem, based on your example, I'm sure it can be solved.

Stefan
LaTeX.org admin
samirazs
Posts: 3
Joined: Thu Jan 17, 2013 10:45 am

Lyx spacing & wrapping

Post by samirazs »

Hi Stefan,

I found what is causing the problem and the solution now :D
The problem was caused by a change in alpha.bst, because I was trying to show the url in misc types.

So I changed this:

Code: Select all

FUNCTION {misc}
{ output.bibitem
  format.authors output
  title howpublished new.block.checkb
  format.title output
  howpublished new.block.checka
  howpublished output
  format.date output
  new.block
  note output
  fin.entry
  empty.misc.check
}
to this:

Code: Select all

FUNCTION {misc}
{ output.bibitem
  format.authors output
  title howpublished new.block.checkb
  format.title output
  howpublished new.block.checka
  howpublished output
  format.date output
  if$
  new.block
  url output
  note output
  fin.entry
  empty.misc.check
}
I found this: http://www.tex.ac.uk/tex-archive/biblio ... phaurl.bst

changed my bst... and now it works :D Thankyou so much!
Last edited by cgnieder on Thu Jan 17, 2013 2:25 pm, edited 1 time in total.
Post Reply