ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* t-bib: URL and '%'; spacing between number and text
@ 2008-03-26 17:48 Tobias Burnus
  2008-03-31 14:17 ` Taco Hoekwater
  0 siblings, 1 reply; 9+ messages in thread
From: Tobias Burnus @ 2008-03-26 17:48 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi all,

I have a .bib file which contains

@article{foo,
  url = {http://..../a%bb%cc.html}

i.e. an URL with % sign. I want to typeset it in the references using:

\def\gotoURL#1{\useURL[foo][#1]\goto{\url[foo]}[url(foo)]}

\unprotect
\setuppublicationlayout[article]{%
...
   \insertbiburl{ }{.}{}%

The problem is: If I do not escape the % signs, I get a TeX error. If I 
escape them with \%, both the link and the printed text show the 
backslash. What is the proper way of doing it?


Another problem is that I have in the reference list, the space between 
"]" and the author name in
 [123]Author
is too small (they overlap). Is there an easy possibility to make the 
spacing automatically right or does one need to tweek it manually?

Tobias


___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: t-bib: URL and '%'; spacing between number and text
  2008-03-26 17:48 t-bib: URL and '%'; spacing between number and text Tobias Burnus
@ 2008-03-31 14:17 ` Taco Hoekwater
  2008-04-03 22:41   ` Tobias Burnus
  0 siblings, 1 reply; 9+ messages in thread
From: Taco Hoekwater @ 2008-03-31 14:17 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Hi Tobias,

Tobias Burnus wrote:
> 
> The problem is: If I do not escape the % signs, I get a TeX error. If I 
> escape them with \%, both the link and the printed text show the 
> backslash. What is the proper way of doing it?

Yikes. There is no 'proper way' afaik, sorry.

I am busy catching up right now, so I have no time to delve into this
for the next few days. You will probably have to remind me (end of the 
week?)

> 
> Another problem is that I have in the reference list, the space between 
> "]" and the author name in
>  [123]Author
> is too small (they overlap). Is there an easy possibility to make the 
> spacing automatically right or does one need to tweek it manually?

   \setuppublications[autohang=yes]

should work

Best wishes,
Taco
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: t-bib: URL and '%'; spacing between number and text
  2008-03-31 14:17 ` Taco Hoekwater
@ 2008-04-03 22:41   ` Tobias Burnus
  2008-04-04  9:39     ` Taco Hoekwater
  0 siblings, 1 reply; 9+ messages in thread
From: Tobias Burnus @ 2008-04-03 22:41 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hello Taco,

Taco Hoekwater wrote:
> Tobias Burnus wrote:
>   
>> The problem is: If I do not escape the % signs, I get a TeX error. If I 
>> escape them with \%, both the link and the printed text show the 
>> backslash. What is the proper way of doing it?
>>     
> Yikes. There is no 'proper way' afaik, sorry.
> I am busy catching up right now, so I have no time to delve into this
> for the next few days. You will probably have to remind me (end of the 
> week?)
>   
OK: * Ping * ;-)

 * * *

I saw in a book some quite interesting author index. It consisted of the 
references followed by the page number(s):

Lastname, A. and B. Smith, My Journal, 44, 1234 (2020).    33, 47, 77

How difficult would it to get it with t-bib? The page numbers would be 
simply the pages where the reference was \cite[]ed.

 * * *

For those, who do not yet know it and are interested: TUG is 
participating in Google Summer of Code, for which the (extended) 
application deadline is next Monday. See also 
http://www.tug.org/gsoc/ideas.html (There are some nice ConTeXt and 
LuaTeX projects listed.)   Taco of cause know more about this ;-)
(While I know more about GCC [and especially gfortran], which had a slow 
start but now 19 fair to excellent applications.)

Tobias
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: t-bib: URL and '%'; spacing between number and text
  2008-04-03 22:41   ` Tobias Burnus
@ 2008-04-04  9:39     ` Taco Hoekwater
  2008-04-04 10:37       ` Tobias Burnus
  0 siblings, 1 reply; 9+ messages in thread
From: Taco Hoekwater @ 2008-04-04  9:39 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 1357 bytes --]



Tobias Burnus wrote:
> Hello Taco,
> 
> Taco Hoekwater wrote:
>> Tobias Burnus wrote:
>>   
>>> The problem is: If I do not escape the % signs, I get a TeX error. If I 
>>> escape them with \%, both the link and the printed text show the 
>>> backslash. What is the proper way of doing it?
>>>     
>> Yikes. There is no 'proper way' afaik, sorry.
>> I am busy catching up right now, so I have no time to delve into this
>> for the next few days. You will probably have to remind me (end of the 
>> week?)
>>   
> OK: * Ping * ;-)

Does this fix I wrote (back in September) actually work?

% start fix
\unprotect
\def\dousepublications#1%
   {\doonlyonce
      {#1.\f!bibextension}
      {\readfile{#1.\f!bibextension}
      {\catcode`\%=12
       \showmessage\m!bib{4}{#1.\f!bibextension}}
      {\showmessage\m!bib{2}{#1.\f!bibextension}}}}
\protect
% end fix

> I saw in a book some quite interesting author index. It consisted of the 
> references followed by the page number(s):
> 
> Lastname, A. and B. Smith, My Journal, 44, 1234 (2020).    33, 47, 77
> 
> How difficult would it to get it with t-bib? The page numbers would be 
> simply the pages where the reference was \cite[]ed.

Not too hard, if you don't mind editting the bib / bbl a bit;
making it truly automatic and still configurable would be hard.
Example attached.

Best wishes,
Taco


[-- Attachment #2: citedpages.tex --]
[-- Type: application/x-tex, Size: 1054 bytes --]

[-- Attachment #3: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: t-bib: URL and '%'; spacing between number and text
  2008-04-04  9:39     ` Taco Hoekwater
@ 2008-04-04 10:37       ` Tobias Burnus
  2008-04-04 10:53         ` Taco Hoekwater
  0 siblings, 1 reply; 9+ messages in thread
From: Tobias Burnus @ 2008-04-04 10:37 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 1074 bytes --]

Taco Hoekwater wrote:
> Does this fix I wrote (back in September) actually work?
>
> % start fix
> \unprotect
> \def\dousepublications#1%
>   {\doonlyonce
>      {#1.\f!bibextension}
>      {\readfile{#1.\f!bibextension}
>      {\catcode`\%=12
>       \showmessage\m!bib{4}{#1.\f!bibextension}}
>      {\showmessage\m!bib{2}{#1.\f!bibextension}}}}
> \protect
> % end fix
It does not seem to work here :-(
   "url = {{foo}}"
becomes now "{foo}" instead of "foo" but the "%" causes still a TeX 
error and the "\%" is printed as "\%".

The attached test case uses \% but replacing it by \% causes TeX errors. 
(publication block as found in the bbl file.)

> Not too hard, if you don't mind editting the bib / bbl a bit;
> making it truly automatic and still configurable would be hard.
> Example attached.
It does not seem to work here. I get "Is cited at ."  (This is with the 
latest cont-tmf.tex and pdfetex of TeX Live 2007 as distributed by 
openSUSE.)

Do I have an too old pdfeTeX version or do I need to do something else 
than just TeXing the file?


Thanks,

Tobias

[-- Attachment #2: test2.tex --]
[-- Type: application/x-tex, Size: 1453 bytes --]

[-- Attachment #3: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: t-bib: URL and '%'; spacing between number and text
  2008-04-04 10:37       ` Tobias Burnus
@ 2008-04-04 10:53         ` Taco Hoekwater
  2008-04-04 12:52           ` Tobias Burnus
  0 siblings, 1 reply; 9+ messages in thread
From: Taco Hoekwater @ 2008-04-04 10:53 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Tobias Burnus wrote:
> Taco Hoekwater wrote:
>> Does this fix I wrote (back in September) actually work?
>>
>> % start fix
>> \unprotect
>> \def\dousepublications#1%
>>   {\doonlyonce
>>      {#1.\f!bibextension}
>>      {\readfile{#1.\f!bibextension}
>>      {\catcode`\%=12
>>       \showmessage\m!bib{4}{#1.\f!bibextension}}
>>      {\showmessage\m!bib{2}{#1.\f!bibextension}}}}
>> \protect
>> % end fix
> It does not seem to work here :-(

It redefines the bbl loader, so inlined \startpublication blocks
will not work. It should work if your publications are in the bbl
file. I can add a similar instruction to \startpublication, but
I want to be sure it works, first.

> The attached test case uses \% but replacing it by \% causes TeX errors. 
> (publication block as found in the bbl file.)

Using \% is wrong in any case, you should be able to write the
url with just percent signs, that is what we are aiming for.

>> Not too hard, if you don't mind editting the bib / bbl a bit;
>> making it truly automatic and still configurable would be hard.
>> Example attached.
> It does not seem to work here. 

I am an idiot. Please add the \doglobal in this  line:

   {\doglobal\addtocommalist{cite-\jobname-\recurselevel}\pagerefs}

Best wishes,
Taco
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: t-bib: URL and '%'; spacing between number and text
  2008-04-04 10:53         ` Taco Hoekwater
@ 2008-04-04 12:52           ` Tobias Burnus
  2008-04-04 13:37             ` Taco Hoekwater
  0 siblings, 1 reply; 9+ messages in thread
From: Tobias Burnus @ 2008-04-04 12:52 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 1260 bytes --]

Taco Hoekwater wrote:
>> It does not seem to work here :-(
>>     
> It redefines the bbl loader, so inlined \startpublication blocks
> will not work. It should work if your publications are in the bbl
> file.
>   

OK. That works for my minimal example, though I have to postprocess the 
*.bbl file as BibTeX converts "longline" into

long%
line

which of cause gives the wrong result here. I use perl for this, which 
seems to work just fine and has, as I believe, no side effects:

$line =~ s/%\n//sg;


However, it fails with my big file (see attachment for a reduced 
example). If I simply include the file without using \environment etc., 
it works. Any idea?


>>> Not too hard, if you don't mind editting the bib / bbl a bit;
>>> making it truly automatic and still configurable would be hard.
>>> Example attached.
>>>       
Now it works well. Thanks.


 * * *

I have another tricky question related to t-bib: I want to use in the 
text references of the type [1-2], [3] and at the end of each chapter I 
do a \placepublication[criterium=chapter], however, at the very end I 
want to have a full authorlist ordered by authoryears (with the page 
numbers). Well, I failed to switch to authornames -- I always get a 
numbered list at the end.

Tobias

[-- Attachment #2: test2b.tex --]
[-- Type: application/x-tex, Size: 148 bytes --]

[-- Attachment #3: environment.tex --]
[-- Type: application/x-tex, Size: 613 bytes --]

[-- Attachment #4: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: t-bib: URL and '%'; spacing between number and text
  2008-04-04 12:52           ` Tobias Burnus
@ 2008-04-04 13:37             ` Taco Hoekwater
  2008-04-12 19:46               ` Tobias Burnus
  0 siblings, 1 reply; 9+ messages in thread
From: Taco Hoekwater @ 2008-04-04 13:37 UTC (permalink / raw)
  To: mailing list for ConTeXt users



Tobias Burnus wrote:
> 
> OK. That works for my minimal example, though I have to postprocess the 
> *.bbl file as BibTeX converts "longline" into
> 
> long%
> line

An afwul tool, that bibtex is. Imagine what having a long url in your
.bib file does ... tinyurl is almost a requirement.

> However, it fails with my big file (see attachment for a reduced 
> example). If I simply include the file without using \environment etc., 
> it works. Any idea?

This is because of the special processing that has to take place
within projects. The only solution for that (right now) is to
patch the definition of \dousepublications inside the bib module
itself.

I'll try to work out something that does not need to grab
all of its argument, so that this hack can be removed again.

> I have another tricky question related to t-bib: I want to use in the 
> text references of the type [1-2], [3] and at the end of each chapter I 
> do a \placepublication[criterium=chapter], however, at the very end I 
> want to have a full authorlist ordered by authoryears (with the page 
> numbers). Well, I failed to switch to authornames -- I always get a 
> numbered list at the end.

Completely switching styles with some command like

   \setuppublications[alternative=apa]

just before the final \completepublications should have succeeded
in creating a non-numbered list, but here again there could be a 
conflict with the project/product structure.

Best wishes,
Taco

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: t-bib: URL and '%'; spacing between number and text
  2008-04-04 13:37             ` Taco Hoekwater
@ 2008-04-12 19:46               ` Tobias Burnus
  0 siblings, 0 replies; 9+ messages in thread
From: Tobias Burnus @ 2008-04-12 19:46 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Taco Hoekwater wrote:
> I'll try to work out something that does not need to grab
> all of its argument, so that this hack can be removed again.
>   
I have a problem with your fix. As I just found out, with that fix, not 
only the % in the bib/bbl are printed (as intended), but also the % in 
the TeX file, i.e. all the sections I commented out now appear - 
prefixed by a %.

Tobias


PS: Your fix was:

% start fix
\unprotect
\def\dousepublications#1%
  {\doonlyonce
     {#1.\f!bibextension}
     {\readfile{#1.\f!bibextension}
     {\catcode`\%=12
      \showmessage\m!bib{4}{#1.\f!bibextension}}
     {\showmessage\m!bib{2}{#1.\f!bibextension}}}}
\protect
% end fix
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2008-04-12 19:46 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-26 17:48 t-bib: URL and '%'; spacing between number and text Tobias Burnus
2008-03-31 14:17 ` Taco Hoekwater
2008-04-03 22:41   ` Tobias Burnus
2008-04-04  9:39     ` Taco Hoekwater
2008-04-04 10:37       ` Tobias Burnus
2008-04-04 10:53         ` Taco Hoekwater
2008-04-04 12:52           ` Tobias Burnus
2008-04-04 13:37             ` Taco Hoekwater
2008-04-12 19:46               ` Tobias Burnus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).